Running multiple parallel Selenium WebDriver sessi

2020-07-20 03:26发布

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条回答
闹够了就滚
2楼-- · 2020-07-20 04:19

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>
查看更多
登录 后发表回答