Selenium synchronous execution of multiple threads in a grid

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.