My goal is to a run test cases parallel on below combination and produce a extent report for each combination, total 8 combination
- Windows (Chrome, Firefox, IE)
- Linux (Chrome, Firefox)
- Mac (Safari, Chrome, Firefox)
Have come up with this after searching over net.
This <suite>
run all <test>
tags parallel and each <test>
represents a OS & browser combination that again run test classes parallel. Each test class has a RemoteWebDriver instance.
- Whether this solution is correct or do i need to make any changes?
- Complexity increases once test classes start increasing I want to add / remove test classes from all 8 test tags.
- If i want run just one combination(os+browser) do i need to have another testng.xml file and edit the parameter values?
- How to get the report for each combination. Since all test are running parallel and multi threaded how to track each test?
TestNg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="tests">
<test name="Windows_Chrome" parallel="classes" thread-count="3">
<parameter name="os" value="windows" />
<parameter name="browser" value="chrome" />
<classes>
<class name="com.mag.SeleniumGrid.Test_001" />
<class name="com.mag.SeleniumGrid.Test_002" />
<class name="com.mag.SeleniumGrid.Test_00N" />
<!--Each class create RemoteWebDriver instance based on parameters-->
</classes>
</test>
<!-- ..... all 8 combinations -->
<test name="Linux_Chrome" parallel="classes" thread-count="3">
<parameter name="os" value="linux" />
<parameter name="browser" value="chrome" />
<classes>
<class name="com.mag.SeleniumGrid.Test_001" />
<class name="com.mag.SeleniumGrid.Test_002" />
<class name="com.mag.SeleniumGrid.Test_00N" />
</classes>
</test>
</suite>