PATCH_068.js.bak 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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<= 10; 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_068_Approval(){
  76. Rand1 = Math.floor(Math.random() * (9 - 0));
  77. dataset.getdata();
  78. dataset1.getdata();
  79. dataset2.getdata();
  80. Delay(3000);
  81. //Clicks the 'textbox' control.
  82. Aliases.browser.page1011261948080.textnode.shadowroot.textnode35.shadowroot.textnode.shadowroot.textbox.Click();
  83. //Delays the test execution for the specified time period.
  84. Delay(3000);
  85. //Sets the text '12345678' in the 'textbox' text editor.
  86. Aliases.browser.page1011261948080.textnode.shadowroot.textnode35.shadowroot.textnode.shadowroot.textbox.SetText(data[1]+data2[1]);
  87. //Delays the test execution for the specified time period.
  88. Delay(3000);
  89. }
  90. function PATCH_068_PLACEMENT_BANK_PART_I(){
  91. Rand1 = Math.floor(Math.random() * (9 - 0));
  92. dataset.getdata();
  93. dataset1.getdata();
  94. dataset2.getdata();
  95. Delay(3000);
  96. //Clicks the 'textbox2' control.
  97. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode7.shadowroot.textbox2.Click();
  98. //Delays the test execution for the specified time period.
  99. Delay(3000);
  100. //Sets the text 'Testing 1234' in the 'textbox2' text editor.
  101. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode7.shadowroot.textbox2.SetText("TESTING AT"+data[1]);
  102. //Delays the test execution for the specified time period.
  103. Delay(3000);
  104. //Clicks the 'textbox' control.
  105. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode8.shadowroot.textbox.Click();
  106. //Delays the test execution for the specified time period.
  107. Delay(3000);
  108. //Sets the text 'Jln. Testing' in the 'textbox' text editor.
  109. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode8.shadowroot.textbox.SetText("Jl. Testing "+data[1]);
  110. //Delays the test execution for the specified time period.
  111. Delay(3000);
  112. //Clicks the 'textbox' control.
  113. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode9.shadowroot.textbox.Click();
  114. //Delays the test execution for the specified time period.
  115. Delay(3000);
  116. //Sets the text '021-12345678' in the 'textbox' text editor.
  117. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode9.shadowroot.textbox.SetText("021-"+data2[0]);
  118. //Delays the test execution for the specified time period.
  119. Delay(3000);
  120. //Clicks the 'textbox' control.
  121. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode10.shadowroot.textbox.Click();
  122. //Delays the test execution for the specified time period.
  123. Delay(3000);
  124. //Sets the text '021-98765432' in the 'textbox' text editor.
  125. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode10.shadowroot.textbox.SetText("021-"+data3[0]);
  126. //Delays the test execution for the specified time period.
  127. Delay(3000);
  128. //Delays the test execution for the specified time period.
  129. }
  130. function PATCH_068_PLACEMENT_BANK_PART_II(){
  131. var today = new Date();
  132. var dd = String(today.getDate()).padStart(2, '0');//date today
  133. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  134. var yyyy = today.getFullYear();
  135. today = yyyy+'-'+mm+'-'+dd;
  136. //Delays the test execution for the specified time period.
  137. Delay(3000);
  138. //Clicks the 'textbox' control.
  139. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode12.shadowroot.textnodeInput.shadowroot.textbox.Click();
  140. //Delays the test execution for the specified time period.
  141. Delay(3000);
  142. //Sets the text '2024-03-28' in the 'textbox' text editor.
  143. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode12.shadowroot.textnodeInput.shadowroot.textbox.SetText(today);
  144. //Delays the test execution for the specified time period.
  145. Delay(3000);
  146. //Enters '[Enter]' in the 'textbox' object.
  147. Aliases.browser.page1011261948080.textnode.shadowroot.textnode34.shadowroot.textnode12.shadowroot.textnodeInput.shadowroot.textbox.Keys("[Enter]");
  148. //Delays the test execution for the specified time period.
  149. Delay(3000);
  150. }