seleniumtestngparallel-testing

TestNG: Parallel Execution: Handling Multiple browser and switching to new Window


  1. I do have a Test Suite with actually 20 Test Cases defined in 20 separate classes which needs to be Executed in parallel in browser Firefox on Linux OS
    1. Some TC's have Java code which handles/opens new windows which passes control to these windows based on title of new window opened
    2. When executed serially all TC's passes.

When trying to execute parallely through Xml file with thread count=3, and timeOut=10 sec(10000 mili sec) maximum for each TC's

My Question: How will the webDriver Handles this situation(If Multiple windows are opened)???? and wont there be a conflict and how will the webDriver transfer the control to Exact windows before the window closes and pass the TC's???? Needs to execute/pass all the 20 Tc's within the maximum time frame.

P.S: Needs some valuable Suggestions to address this issue.


Solution

  • Webdriver has nothing to do with parallelization, It is TestNG feature. Basically we execute testng tests in parallel which spawns their own browsers or driver instances, these instances are totally independent of each other and are uniquely identified by sessionid. Now even if some of these browser open in new tab or window they are tightly coupled because sessionid remains the same. I can confirm this because i have maintained such a setup and with no problem.