Requirements: There is a workflow, each step of approval requires multiple leaders to participate in order to push the process to the next step
Code thinking: Multiple leaders running in their own thread, speed some fast slow, how to ensure that the next leadership approval, this step has been activated
Here is the code: the idea is: if this step is activated, you can do this step of the work, if not activated, so that he waits a second, loop waiting
for (int i = 0; i < 10000; i++) {String keyword = (string) ((Javascriptexecutor) driver). Executescript ("Var src = document.getElementById (\ "cbpnavbar_navbarmenu_gctc1_ctl00_1_aspxnavbar1_1_i0i0_img\"). Src;return src "); if (keyword = = "Images/newimages/left_icon_f_3.png" | | keyword.endswith ("f_3.png")) {System.out.println (keywor D); ((Javascriptexecutor) driver). Executescript ("Arguments[0].click ();", P2.sjhsps ()); Break } else {thread.sleep (1000); System.out.println ("Add 1 seconds .........") "); }
}
Selenium synchronous execution of multiple threads in a grid