TestNG :
http://testng.org/testng-1.0.dtd">
<suite name="Parallel test suite">
<test name="Firefox Test">
<parameter name="browser" value="
firefox"/>
<classes>
<class name="com.pack.ParallelTest"/>
</classes>
</test>
<test name="Chrome Test">
<parameter name="browser" value="chrome"/>
<classes>
<class name="com.pack.ParallelTest"/>
</classes>
</test>
<test name="Internet Explorer Test">
<parameter name="browser" value="
iexplore"/>
<classes>
<class name="com.pack.ParallelTest"/>
</classes>
</test>
</suite>
Write your Java WebDriver code as below:
@Parameters({"browser"})
@BeforeClass
public void setUp(String
browser) {
if(browser.equalsIgnoreCase("iexplore")){
driver = new InternetExplorerDriver();
}
if(browser.equalsIgnoreCase("firefox")){
driver = new FirefoxDriver();
}
if(browser.equalsIgnoreCase("chrome")){
driver = new ChromeDriver();
}
driver.manage().window().maximize();
}
No comments:
Post a Comment