I am wondering if we are able to run two Selenium WebDriver sessions, or how I can handle two browser windows using the same WebDriver and run them in parallel.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Try to define your TestNg suite like the below and then it will start running both at a time.
<suite name="TestSuite" parallel="tests" thread-count="2">
<test name="Test1" preserve-order="true">
<parameter name="baseURL" value="http://www.amazon.com" />
<classes>
<class name="package.myClass" />
</classes>
</test>
<test name="Test2" preserve-order="true">
<parameter name="baseURL" value="http://www.google.com" />
<classes>
<class name="package.myClass" />
</classes>
</test>