This link will help u. http://abodeqa.wordpress.com/2013/02/21/how-to-execute-selenium-webdriver-test-cases-parallel-in-multiple-browser-using-testng-parameter-annotation/
Topic: To run selenium test scripts in IE & FF parallel: You need to define "parallel" in your TestNG xml file and create a parameter and pass to your method.
Suppose say you create this xml file as test.xml. Assume your class name is "YourClassName". You need to have two blocks for this class an you are passing parameter name= browser to your method.
For ex: the test.xml file should have like this:
–>
You create a class with a method something like this:
public class LaunchBrowser {
WebDriver driver=null;
// Pass parameter browser from test.xml @Parameters(“browser”) public void initiateBrowser(String browser){
// compare browser to fire fox and then open firefox driver if(browser.equals(“Firefox”)) {
driver = new FirefoxDriver(); } else { \ set path to the IE driver correctly here System.setProperty("webdriver.ie.driver", "\iexploredriver.exe"); driver =new InternetExplorerDriver(); } }
Now create YourClassName class and call extend the above class something like this
@Test public class YourClassName extends LaunchBrowser{
public void gotoGoogle(){
driver.get(“http://www.google.com"); } }
Now it should launch chrome and Firefox together and should go to google web site. Hope this helps
please publish this answer
ReplyDeleteThis link will help u.
Deletehttp://abodeqa.wordpress.com/2013/02/21/how-to-execute-selenium-webdriver-test-cases-parallel-in-multiple-browser-using-testng-parameter-annotation/
By Using JVM also we can achieve this..
DeleteThis link can help you :
Deletehttps://medium.com/automation-testing/selenium-grid-and-testng-d589127b2ab2
We can do by using multy threading in Java
Deletethanks Sanjay
DeleteUse this
ReplyDelete
ReplyDelete–>
may be this link help you
ReplyDeletehttps://groups.google.com/forum/#!topic/webdriver/D5q9y7w_Qm4
Topic: To run selenium test scripts in IE & FF parallel:
ReplyDeleteYou need to define "parallel" in your TestNG xml file and create a parameter and pass to your method.
Suppose say you create this xml file as test.xml. Assume your class name is "YourClassName". You need to have two blocks for this class an you are passing parameter name= browser to your method.
For ex: the test.xml file should have like this:
–>
You create a class with a method something like this:
public class LaunchBrowser {
WebDriver driver=null;
// Pass parameter browser from test.xml
@Parameters(“browser”)
public void initiateBrowser(String browser){
// compare browser to fire fox and then open firefox driver
if(browser.equals(“Firefox”))
{
driver = new FirefoxDriver();
}
else
{
\ set path to the IE driver correctly here
System.setProperty("webdriver.ie.driver", "\iexploredriver.exe");
driver =new InternetExplorerDriver();
}
}
Now create YourClassName class and call extend the above class something like this
@Test
public class YourClassName extends LaunchBrowser{
public void gotoGoogle(){
driver.get(“http://www.google.com");
}
}
Now it should launch chrome and Firefox together and should go to google web site. Hope this helps
Hi,
DeleteNot able to view test.xml file here....
Please repost.
using Groups
ReplyDelete@Test(group= {Functional, UI} )
public static goToTweets()
{
//some code
}
Adding in the previous post ..
ReplyDeletethen in testng.xml includes that group
http://seleniumguru.in/?p=255
ReplyDeleteAbove link will give you brief programm with example