- MstWnted
- Posts : 3
Join date : 2011-01-06
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.
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.
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
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
- MstWnted
- Posts : 3
Join date : 2011-01-06
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..
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
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..
- How to embed webdriver browser into java GUI/ attach to exsisting browser
- opera browser not loading the page using selenium Rc(Java)
- Warning -> Failed to start: SocketListener , while performing Cross Browser Testing
- do not run browser, when start selenium testing
- New user extenstion for browser related testing.
Permissions in this forum:
You cannot reply to topics in this forum