Upload_issuance_121.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. function issuance121()
  2. {
  3. var registrarCode = Project.Variables.code.Value("codeRegister");
  4. var url = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Issuance 121\\issuance_121.sti";
  5. var zip = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Issuance 121\\issuance_121.zip";
  6. var account = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell70.innerText;
  7. var account2 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell72.innerText;
  8. var securityCode = Project.Variables.code.Value("instrumenLocalCode");
  9. var certif12 = Project.Variables.certificate.Value("certif12");
  10. var certif13 = Project.Variables.certificate.Value("certif13");
  11. var certif14 = Project.Variables.certificate.Value("certif14");
  12. var certif15 = Project.Variables.certificate.Value("certif15");
  13. var today = new Date();
  14. var dd = String(today.getDate()).padStart(2, '0');
  15. var mm = String(today.getMonth() + 1).padStart(2, '0');
  16. var yyyy = today.getFullYear();
  17. today = yyyy + mm + dd;
  18. var template =
  19. '<Message>\n'+
  20. '<Record name="data">\n'+
  21. '<Field name="externalReference">'+certif12+'</Field>\n'+
  22. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  23. '<Field name="account">'+account+'</Field>\n'+
  24. '<Field name="securityCodeType">LOCAL</Field>\n'+
  25. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  26. '<Field name="issuedQuantity">120</Field>\n'+
  27. '<Field name="settlementDate">'+today+'</Field>\n'+
  28. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  29. '<Field name="certificateNumber">'+certif12+'</Field>\n'+
  30. '<Field name="shareRanges">661-780</Field>\n'+
  31. '<Field name="shareSeries">B</Field>\n'+
  32. '<Field name="reason">ISSU</Field>\n'+
  33. '<Field name="otherMemberCode">9X000</Field>\n'+
  34. '</Record>\n'+
  35. '<Record name="data">\n'+
  36. '<Field name="externalReference">'+certif13+'</Field>\n'+
  37. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  38. '<Field name="account">'+account+'</Field>\n'+
  39. '<Field name="securityCodeType">LOCAL</Field>\n'+
  40. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  41. '<Field name="issuedQuantity">130</Field>\n'+
  42. '<Field name="settlementDate">'+today+'</Field>\n'+
  43. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  44. '<Field name="certificateNumber">'+certif13+'</Field>\n'+
  45. '<Field name="shareRanges">781-910</Field>\n'+
  46. '<Field name="shareSeries">B</Field>\n'+
  47. '<Field name="reason">ISSU</Field>\n'+
  48. '<Field name="otherMemberCode">9X000</Field>\n'+
  49. '</Record>\n'+
  50. '<Record name="data">\n'+
  51. '<Field name="externalReference">'+certif14+'</Field>\n'+
  52. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  53. '<Field name="account">'+account2+'</Field>\n'+
  54. '<Field name="securityCodeType">LOCAL</Field>\n'+
  55. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  56. '<Field name="issuedQuantity">140</Field>\n'+
  57. '<Field name="settlementDate">'+today+'</Field>\n'+
  58. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  59. '<Field name="certificateNumber">'+certif14+'</Field>\n'+
  60. '<Field name="shareRanges">911-1050</Field>\n'+
  61. '<Field name="shareSeries">B</Field>\n'+
  62. '<Field name="reason">ISSU</Field>\n'+
  63. '<Field name="otherMemberCode">9X000</Field>\n'+
  64. '</Record>\n'+
  65. '<Record name="data">\n'+
  66. '<Field name="externalReference">'+certif15+'</Field>\n'+
  67. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  68. '<Field name="account">'+account2+'</Field>\n'+
  69. '<Field name="securityCodeType">LOCAL</Field>\n'+
  70. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  71. '<Field name="issuedQuantity">150</Field>\n'+
  72. '<Field name="settlementDate">'+today+'</Field>\n'+
  73. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  74. '<Field name="certificateNumber">'+certif15+'</Field>\n'+
  75. '<Field name="shareRanges">1051-1200</Field>\n'+
  76. '<Field name="shareSeries">B</Field>\n'+
  77. '<Field name="reason">ISSU</Field>\n'+
  78. '<Field name="otherMemberCode">9X000</Field>\n'+
  79. '</Record>\n'+
  80. '</Message>'
  81. if (aqFile.Create(url) == 0)
  82. {
  83. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  84. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  85. }
  86. else
  87. {
  88. aqFile.Delete(url);
  89. aqFile.Delete(zip);
  90. if (aqFile.Create(url) == 0)
  91. {
  92. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  93. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  94. }
  95. }
  96. }