Upload_Unclaimed_asset.js 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. function uploadUnclaimedAsset()
  2. {
  3. var issuerCode = Project.Variables.code.Value("issuerCode");
  4. var registrarCode = Project.Variables.code.Value("codeRegister");
  5. var clientCode1 = Project.Variables.code.Value("accountClientCode1");
  6. var clientCOde2 = Project.Variables.code.Value("accountClientCode2");
  7. var clientCode3 = Project.Variables.code.Value("accountClientCode3");
  8. var clientCode4 = Project.Variables.code.Value("accountClientCode4");
  9. var instituionalCode = Project.Variables.code.Value("instituionalCode");
  10. var url = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Unclaimed Asset Investor\\account_sdiuc.sdiuc";
  11. var zip = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Unclaimed Asset Investor\\account_sdiuc.zip";
  12. var template =
  13. '<Message>\n'+
  14. '<Record name="data">\n'+
  15. '<Field name="registrarRef">REF01</Field>\n'+
  16. '<Field name="accountParticipantCode">'+registrarCode+'</Field>\n'+
  17. '<Field name="accountIssuerCode">'+issuerCode+'</Field>\n'+
  18. '<Field name="accountClientCode">'+clientCode1+'</Field>\n'+
  19. '<Field name="accountOptionType">SEC</Field>\n'+
  20. '<Field name="accountType">121</Field>\n'+
  21. '<Field name="accountOwner">1</Field>\n'+
  22. '<Field name="accountDescription">Automation 01</Field>\n'+
  23. '<Field name="accountAction">CREATE</Field>\n'+
  24. '<Field name="accountStakeholderType">I</Field>\n'+
  25. '</Record>\n'+
  26. '<Record name="data">\n'+
  27. '<Field name="registrarRef">REF02</Field>\n'+
  28. '<Field name="accountParticipantCode">'+registrarCode+'</Field>\n'+
  29. '<Field name="accountIssuerCode">'+issuerCode+'</Field>\n'+
  30. '<Field name="accountClientCode">'+clientCOde2+'</Field>\n'+
  31. '<Field name="accountOptionType">SEC</Field>\n'+
  32. '<Field name="accountType">121</Field>\n'+
  33. '<Field name="accountOwner">1</Field>\n'+
  34. '<Field name="accountDescription">Automation 02</Field>\n'+
  35. '<Field name="accountAction">CREATE</Field>\n'+
  36. '<Field name="accountStakeholderType">I</Field>\n'+
  37. '</Record>\n'+
  38. '<Record name="data">\n'+
  39. '<Field name="registrarRef">REF03</Field>\n'+
  40. '<Field name="accountParticipantCode">'+registrarCode+'</Field>\n'+
  41. '<Field name="accountIssuerCode">'+issuerCode+'</Field>\n'+
  42. '<Field name="accountClientCode">'+clientCode3+'</Field>\n'+
  43. '<Field name="accountOptionType">SEC</Field>\n'+
  44. '<Field name="accountType">121</Field>\n'+
  45. '<Field name="accountOwner">1</Field>\n'+
  46. '<Field name="accountDescription">Automation 03</Field>\n'+
  47. '<Field name="accountAction">CREATE</Field>\n'+
  48. '<Field name="accountStakeholderType">I</Field>\n'+
  49. '</Record>\n'+
  50. '<Record name="data">\n'+
  51. '<Field name="registrarRef">REF04</Field>\n'+
  52. '<Field name="accountParticipantCode">'+registrarCode+'</Field>\n'+
  53. '<Field name="accountIssuerCode">'+issuerCode+'</Field>\n'+
  54. '<Field name="accountClientCode">'+clientCode4+'</Field>\n'+
  55. '<Field name="accountOptionType">SEC</Field>\n'+
  56. '<Field name="accountType">121</Field>\n'+
  57. '<Field name="accountOwner">1</Field>\n'+
  58. '<Field name="accountDescription">Automation 04</Field>\n'+
  59. '<Field name="accountAction">CREATE</Field>\n'+
  60. '<Field name="accountStakeholderType">I</Field>\n'+
  61. '</Record>\n'+
  62. '</Message>'
  63. if (aqFile.Create(url) == 0)
  64. {
  65. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  66. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  67. }
  68. else
  69. {
  70. aqFile.Delete(url);
  71. aqFile.Delete(zip);
  72. if (aqFile.Create(url) == 0)
  73. {
  74. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  75. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  76. }
  77. }
  78. }