Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
MstWnted
Posts : 3
Join date : 2011-01-06

Multi browser testing JAVA Empty Multi browser testing JAVA

Thu Jan 06, 2011 11:13 pm
Hi,

I have written code which works fine with firefox.

I now want the same code to work with IE, but I do not want to manually change the browser config.

Rather, I would like the same testcase to run first in firefox then IE and so forth, without duplicating any code.

thanks.
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

Multi browser testing JAVA Empty Re: Multi browser testing JAVA

Fri Jan 07, 2011 11:10 pm
just take value of browser into an array or variable and pass it into command in which you are setting port , browser and host

put all code into loop such that it read first value of browser from array, execute your all code.

after finishing it reads second browser value , execute all code and so on

so only one thing you add into your code is looping logic with browser variable.

Rest things will remain same, hope this will help u.

Best of luck
avatar
MstWnted
Posts : 3
Join date : 2011-01-06

Multi browser testing JAVA Empty Re: Multi browser testing JAVA

Sat Jan 08, 2011 7:13 pm
Hi Adviser

thanks for the reply..the issue is that I am making my tests around the testng framework..so i already have my tests running multiple times (with the same steps) but with different data (using the data provider facility)..and I launch the browser from the config method (beforeMethod)..

is there any way I can feed multiple browser paths to the defaultSelenium constructor?..because I shall be using ant to run the testng tests..which shall be in java files..which shall then go to the selenium RC..after which the ant will build a testng-xslt report..
avatar
MstWnted
Posts : 3
Join date : 2011-01-06

Multi browser testing JAVA Empty Re: Multi browser testing JAVA

Mon Jan 10, 2011 6:30 pm
yeah dont worry..got it working..testng allows parameters via the testng.xml to be fed in to the config methods..so i setup various test suites in there for each browser im testing in..passed the browser path..and it launches each one just fine..well expect for IE 8..but i think thats another story..
Sponsored content

Multi browser testing JAVA Empty Re: Multi browser testing JAVA

Back to top
Permissions in this forum:
You cannot reply to topics in this forum