-1

Please find the below requirement.

1- We are having web application which need to tested for different environment.

Application remains same but URL and login Credentials will be different for each environment.

we need to run automation scripts for more the 20 different environment.

2- Ask is to open the new tabs instead of creating the new instance of browser for each environment and do the parallel execution of the scripts for all the environment.

Number of environments might increase.

Please provide the inputs how can we achieve the above automation scenario?

Thanks in advance

Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73

2 Answers2

0

As stated in this topic

If there is a link that opens up a new window/tab, then you can use

driver.switchTo().window();

However, if you want to run something on multiple windows, then I recommend having multiple instances of webdriver. It is much easier to manage, and is supported (There are workarounds on opening a new tab/window, such as pressing a hotkey that opens a new window, but they aren't supported).

If you are wanting to have multiple threads all act on the same driver instance, but different tabs, that is NOT possible.

EDIT: Quoted incorrectly

Community
  • 1
  • 1
SunnyH
  • 67
  • 11
0

By running multiple tests in the same browser instance you are compromising your tests. There will contention for resources and depending upon your application, focus issues with the cursor and mouse.

Selenium is designed to test a single instance of the browser. If you would like to run more tests then run more browsers. If you cannot run multiple instances safely and correctly locally (for resource reasons) then investigate the many options for remote testing such as BrowserStack or Sauce Labs.

Ken Brittain
  • 2,255
  • 17
  • 21