PATCH_013.js.bak 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1.  function xdata(param) {
  2. var randyi = "";
  3. for (ii = 0; ii<= 3; ii++ ) {
  4. randy = Math.floor(Math.random() * (9 - 0));
  5. randyi = randyi + randy.toString();
  6. }
  7. var ktp = "";
  8. for (i = 0; i<= 12; i++ ) {
  9. Rand = Math.floor(Math.random() * (9 - 0));
  10. ktp = ktp + Rand.toString();
  11. }
  12. this.getdata = function datacollection() {
  13. data = [ktp, randyi]
  14. }
  15. }
  16. const dataset = new xdata();
  17. function xdata2(param1) {
  18. var randy2 = "";
  19. for (ii = 0; ii<= 3; ii++ ) {
  20. randy3 = Math.floor(Math.random() * (9 - 0));
  21. randy2 = randy2 + randy3.toString();
  22. }
  23. var npwp = "";
  24. for (i = 0; i<= 15; i++ ) {
  25. Rand3 = Math.floor(Math.random() * (9 - 0));
  26. npwp = npwp + Rand3.toString();
  27. }
  28. this.getdata = function datacollection() {
  29. data2 = [npwp, randy2]
  30. }
  31. }
  32. const dataset1 = new xdata2();
  33. function xdata3(param2) {
  34. var randy3 = "";
  35. for (ii = 0; ii<= 3; ii++ ) {
  36. randy4 = Math.floor(Math.random() * (9 - 0));
  37. randy3 = randy3 + randy4.toString();
  38. }
  39. var sub = "";
  40. for (i = 0; i<= 9; i++ ) {
  41. Rand4 = Math.floor(Math.random() * (9 - 0));
  42. sub = sub + Rand4.toString();
  43. }
  44. this.getdata = function datacollection() {
  45. data3 = [sub, randy4]
  46. }
  47. }
  48. const dataset2 = new xdata3();
  49. function checkCode() {
  50. for (i = 0; i <= 10; i++){
  51. if (Aliases.PTW.dlg.btnOK.Exists) {
  52. Aliases.PTW.dlg.btnOK.ClickButton();
  53. let wizardControl2_1 = Aliases.PTW.Wizard2.WizardControl2;
  54. let panel = wizardControl2_1.panel2;
  55. panel.panelLeft.panelStepLabels.CondicoLabel3.Click(29, 11);
  56. Delay(2000)
  57. condicoPlainTextBox.SetText(generateCode());
  58. Delay(2000)
  59. wizardControl2_1.kryptonGroupButtons.tableLayoutPanel2.flowLayoutPanel2.tableLayoutPanel1.btnFinish.ClickButton();
  60. Delay(15000)
  61. }else {
  62. break;
  63. }
  64. }
  65. }
  66. function generateCode(randyi) {
  67. var randyi = "";
  68. for (ii = 0; ii<= 3; ii++ ) {
  69. randy = Math.floor(Math.random() * (9 - 0));
  70. randyi = randyi + randy.toString();
  71. }
  72. randyi = "T"+randyi;
  73. return randyi;
  74. }
  75. function PATCH_013_GET_FUND_NAME() {
  76. let fund = Aliases.browser.page1011261948080.textnode.shadowroot.textnode7.shadowroot.textbox.Text;
  77. let url = "C:\\Users\\vendor_qafusi4\\Documents\\S-INVEST GUI\\S-Invest GUI\\Data Source\\Data Input\\02. Fund Data Management\\patch_012_fund_registration.txt";
  78. var descripsi = 'Testing Fund '+aqConvert.DateTimeToFormatStr(aqDateTime.Today(), "%Y%m%d");
  79. var today = new Date();
  80. var closing = new Date();
  81. var dd = String(today.getDate()).padStart(2, '0');//date today
  82. var dd2 = String(today.getDate() + 2).padStart(2, '0');// 2 Hari kemudian
  83. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  84. var yyyy = today.getFullYear();
  85. today = yyyy+'-'+mm+'-'+dd;
  86. closing = yyyy+'-'+mm+'-'+dd2;
  87. let template =
  88. 'fundName'+','+'description'+','+'effectiveDate'+','+'closingDate\n'+
  89. ''+fund+','+descripsi+','+today+','+closing+''
  90. ;
  91. if (aqFile.Create(url) == 0)
  92. {
  93. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  94. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  95. }
  96. else
  97. {
  98. aqFile.Delete(url);
  99. if (aqFile.Create(url) == 0)
  100. {
  101. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  102. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  103. }
  104. }
  105. }
  106. function PATCH_013_AMEND_FUND(){
  107. Rand1 = Math.floor(Math.random() * (9 - 0));
  108. dataset.getdata();
  109. dataset1.getdata();
  110. dataset2.getdata();
  111. //Clicks the 'textbox' control.
  112. Aliases.browser.page1011261948080.textnode.shadowroot.textnode8.shadowroot.textbox.Click();
  113. //Delays the test execution for the specified time period.
  114. Delay(3000);
  115. //Enters '^a' in the 'textbox' object.
  116. Aliases.browser.page1011261948080.textnode.shadowroot.textnode8.shadowroot.textbox.Keys("^a");
  117. //Delays the test execution for the specified time period.
  118. Delay(3000);
  119. //Sets the text '12345678901234' in the 'textbox' text editor.
  120. Aliases.browser.page1011261948080.textnode.shadowroot.textnode8.shadowroot.textbox.SetText(data2[0]);
  121. //Delays the test execution for the specified time period.
  122. Delay(3000);
  123. //Clicks the 'textbox' control.
  124. Aliases.browser.page1011261948080.textnode.shadowroot.textnode15.shadowroot.textbox.Click();
  125. //Delays the test execution for the specified time period.
  126. Delay(3000);
  127. //Enters '^a' in the 'textbox' object.
  128. Aliases.browser.page1011261948080.textnode.shadowroot.textnode15.shadowroot.textbox.Keys("^a");
  129. //Delays the test execution for the specified time period.
  130. Delay(3000);
  131. //Sets the text '1234567890' in the 'textbox' text editor.
  132. Aliases.browser.page1011261948080.textnode.shadowroot.textnode15.shadowroot.textbox.SetText(data3[0]);
  133. //Delays the test execution for the specified time period.
  134. Delay(3000);
  135. //Clicks the 'textbox2' control.
  136. Aliases.browser.page1011261948080.textnode.shadowroot.textnode17.shadowroot.textbox2.Click();
  137. //Delays the test execution for the specified time period.
  138. Delay(3000);
  139. //Enters '^a' in the 'textbox2' object.
  140. Aliases.browser.page1011261948080.textnode.shadowroot.textnode17.shadowroot.textbox2.Keys("^a");
  141. //Delays the test execution for the specified time period.
  142. Delay(3000);
  143. //Sets the text '12345678901234' in the 'textbox2' text editor.
  144. Aliases.browser.page1011261948080.textnode.shadowroot.textnode17.shadowroot.textbox2.SetText(data[0]);
  145. //Delays the test execution for the specified time period.
  146. Delay(3000);
  147. }
  148. function PATCH_025(){
  149. Rand1 = Math.floor(Math.random() * (9 - 0));
  150. dataset.getdata();
  151. dataset1.getdata();
  152. dataset2.getdata();
  153. Delay(3000);
  154. //Clicks the 'textbox' control.
  155. Aliases.browser.page1011261948080.textnode.shadowroot.textnode30.shadowroot.textnodeTxtfundshortnameafter.shadowroot.textbox.Click();
  156. //Delays the test execution for the specified time period.
  157. Delay(3000);
  158. //Sets the text 'TE2103' in the 'textbox' text editor.
  159. Aliases.browser.page1011261948080.textnode.shadowroot.textnode30.shadowroot.textnodeTxtfundshortnameafter.shadowroot.textbox.SetText("TE"+data[1]);
  160. //Delays the test execution for the specified time period.
  161. Delay(3000);
  162. }