Upload_Free_Float.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. function uploadFreeFloat()
  2. {
  3. var registrarCode = Project.Variables.code.Value("codeRegister");
  4. var instrumenLocalCode = Project.Variables.code.Value("instrumenLocalCode");
  5. var sre1 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell70.innerText;
  6. var sre2 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell72.innerText;
  7. var sre3 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell73.innerText;
  8. var sre4 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell74.innerText;
  9. var template =
  10. 'kodeBAE|kodeEfek|SRE|type|statusData \n'+
  11. ''+registrarCode+'|'+''+instrumenLocalCode+'|'+''+sre1+''+'|1|1\n'+
  12. ''+registrarCode+'|'+''+instrumenLocalCode+'|'+''+sre2+''+'|2|1\n'+
  13. ''+registrarCode+'|'+''+instrumenLocalCode+'|'+''+sre3+''+'|3|1\n'+
  14. ''+registrarCode+'|'+''+instrumenLocalCode+'|'+''+sre4+''+'|4|1'
  15. ;
  16. if (aqFile.Create("C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Free Float Exception\\freefloat.csv") == 0)
  17. {
  18. aqFile.WriteToTextFile("C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Free Float Exception\\freefloat.csv", template, aqFile.ctUTF8);
  19. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  20. }
  21. else
  22. {
  23. aqFile.Delete("C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Free Float Exception\\freefloat.csv");
  24. aqFile.Delete("C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Free Float Exception\\freefloat.zip");
  25. if (aqFile.Create("C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Free Float Exception\\freefloat.csv") == 0)
  26. {
  27. aqFile.WriteToTextFile("C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Free Float Exception\\freefloat.csv", template, aqFile.ctUTF8);
  28. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  29. }
  30. }
  31. }