Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Multi browser testing JAVA

View previous topic View next topic Go down

Multi browser testing JAVA

Post by MstWnted on 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.

MstWnted

Posts : 3
Join date : 2011-01-06

Back to top Go down

Re: Multi browser testing JAVA

Post by Adviser on 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

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: Multi browser testing JAVA

Post by MstWnted on 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..

MstWnted

Posts : 3
Join date : 2011-01-06

Back to top Go down

Re: Multi browser testing JAVA

Post by MstWnted on 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..

MstWnted

Posts : 3
Join date : 2011-01-06

Back to top Go down

Re: Multi browser testing JAVA

Post by Sponsored content Today at 11:00 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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