dailydose

JavaScript.js

Jan 30th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var appointment_form;
  2. var timeout_counter = 0;
  3. var sec_for_wait = 5
  4.  
  5. // Step 1:
  6. var ms = sec_for_wait * 1000;
  7. timeout_counter += ms;
  8. setTimeout
  9. (
  10.     function()
  11.     {
  12.         // click first list
  13.         appointment_form = document.getElementById("appointment_form");
  14.         appointment_form.getElementsByClassName("select-input")[0].click();
  15.         // select item from list
  16.         setTimeout
  17.         (
  18.             function()
  19.             {
  20.                 var ul_list = appointment_form.getElementsByClassName("select-holder")[0];
  21.                 var li_rows = ul_list.getElementsByClassName("select-item");
  22.                 li_rows[22].click();
  23.             },
  24.             ms
  25.         );
  26.     },
  27.     timeout_counter
  28. );
  29.  
  30. // Step 2:
  31. timeout_counter += ms * 2;
  32. setTimeout
  33. (
  34.     function()
  35.     {
  36.         // click second list
  37.         appointment_form.getElementsByClassName("select-input")[1].click();
  38.         // select item from list
  39.         setTimeout
  40.         (
  41.             function()
  42.             {
  43.                 var ul_list = appointment_form.getElementsByClassName("select-holder")[1];
  44.                 var li_rows = ul_list.getElementsByClassName("select-item");
  45.                 li_rows[1].click();
  46.             },
  47.             ms
  48.         );
  49.     },
  50.     timeout_counter
  51. );
  52.  
  53. // Step 3:
  54. timeout_counter += ms * 2;
  55. setTimeout
  56. (
  57.     function()
  58.     {
  59.         // click third list
  60.         appointment_form.getElementsByClassName("select-input")[2].click();
  61.         // select item from list
  62.         setTimeout
  63.         (
  64.             function()
  65.             {
  66.                 var ul_list = appointment_form.getElementsByClassName("select-holder")[2];
  67.                 var li_rows = ul_list.getElementsByClassName("select-item");
  68.                 li_rows[7].click();
  69.             },
  70.             ms
  71.         );
  72.     },
  73.     timeout_counter
  74. );
  75.  
  76. // Step 3:
  77. timeout_counter += ms * 2;
  78. setTimeout
  79. (
  80.     function()
  81.     {
  82.         // click third list
  83.         appointment_form.getElementsByClassName("select-input")[3].click();
  84.         // select item from list
  85.         setTimeout
  86.         (
  87.             function()
  88.             {
  89.                 var ul_list = appointment_form.getElementsByClassName("select-holder")[3];
  90.                 var li_rows = ul_list.getElementsByClassName("select-item");
  91.                 li_rows[1].click();
  92.             },
  93.             ms
  94.         );
  95.     },
  96.     timeout_counter
  97. );
  98.  
  99. // Step 5:
  100. timeout_counter += ms * 2;
  101. setTimeout
  102. (
  103.     function()
  104.     {
  105.         setTimeout
  106.         (
  107.             function()
  108.             {
  109.                 var step4 = document.getElementById("step-4");
  110.                 step4.getElementsByClassName("radio")[0].click();
  111.             },
  112.             ms
  113.         );
  114.     },
  115.     timeout_counter
  116. );
Advertisement
Add Comment
Please, Sign In to add comment