12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- function issuance()
- {
- var registrarCode = Project.Variables.code.Value("codeRegister");
- var url = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Transfer\\transfer.str";
- var zip = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Transfer\\transfer.zip";
- var account1 = Project.Variables.getAccount1.Value("sid1");
- var account2 = Project.Variables.getAccount2.Value("sid2");
- var securityCode = Project.Variables.code.Value("instrumenLocalCode");
- var certif2 = Project.Variables.certificate.Value("certif2");
-
- var today = new Date();
- var dd = String(today.getDate()).padStart(2, '0');
- var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
- var yyyy = today.getFullYear();
- today = yyyy + mm + dd;
-
- var template =
- '<Message>\n'+
- '<Record name="data">\n'+
- '<Field name="externalReference">'+certif2+'</Field>\n'+
- '<Field name="participantCode">'+registrarCode+'</Field>\n'+
- '<Field name="sourceAccount">'+account1+'</Field>\n'+
- '<Field name="targetAccount">'+account2+'</Field>\n'+
- '<Field name="securityCodeType">ISIN</Field>\n'+
- '<Field name="securityCode">'+securityCode+'</Field>\n'+
- '<Field name="numberOfSecurities">11</Field>\n'+
- '<Field name="settlementDate">'+today+'</Field>\n'+
- '<Field name="description">Testing</Field>\n'+
- '<List name="CertificateList">\n'+
- '<Field name="Certificate">'+certif2+'</Field>\n'+
- '</List>\n'+
- '<Field name="reason">TRAD</Field>\n'+
- '</Record>\n'+
- '</Message>' ;
-
-
- if (aqFile.Create(url) == 0)
- {
-
- aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
- Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
- }
- else
- {
- aqFile.Delete(url);
- aqFile.Delete(zip);
- if (aqFile.Create(url) == 0)
- {
-
- aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
- Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
- }
- }
- }
|