Luc Delmon
Luc Delmon

Reputation: 11

How can I run exported Selenium IDE Test against different browsers

Hello I'm having trouble running Selenium test created by Selenium IDE.

My main problem is that I don't know where to go.

I created a test in the Selenium IDE. I can make it work on Firefox from the IDE and save it in HTML, java, python, C#, Perl. That was the first ( easy ) part.

I would now like to execute the same test on another browser ( doesn't matter the language but I will focus on letting the test himself either in HTML or java).

That's where I don't know where to go. The IDE documentation talk about " using a simple command-line interface that invokes the Selenium-RC server. " but on other part of the website you can see that Selenium RC is officially deprecated.

Things seems to be replaced by Selenium 1.0 + Selenium WebDriver where Selenium WebDriver fits in the same role as RC did.

Then on the download page you have this line:

-To run Selenium tests exported from IDE, use the Selenium Html Runner.

with a link to a jar and no documentation at all.

So, today which one should I use :

Selenium-RC server , Selenium WebDriver or the Selenium Html Runner ?

and how do they work, do my test cases need to stay in HTML or move to java?

The final goal is to run those tests using Jenkins, which also contains plugin for Selenium that may help.

Thanks for your answers.

Upvotes: 1

Views: 1727

Answers (2)

DMart
DMart

Reputation: 2461

To run Selenium HtmlSuite by using Selenium-Standalone Server (Selenium RC): http://www.seleniumhq.org/docs/05_selenium_rc.jsp#run-selenese-directly-within-the-server-using-htmlsuite

java -jar selenium-server.jar -htmlSuite "*firefox" "http://10.8.100.106" "C:\mytestsuite\mytestsuite.html" "C:\mytestsuite\results.html"

But I think WebDriver has retired/changed that format.

Upvotes: 1

Sudha Velan
Sudha Velan

Reputation: 633

  1. Export you testcase as java file enter image description here

  2. Save this file some where in you machine

  3. Download following jars:

  4. Open eclipse

  5. Create a java project , add a package (Check your exported java file copy the package name and create a package)

enter image description here 6. Copy the java file to the newly created package , change the class name's first letter as small case

enter image description here

  1. Add required jar file as follow: Both testng jar & selenium satndalone jar enter image description here enter image description here

  2. Now change the driver, whcih ever you want: I have changed the ff driver to chrome enter image description here

If you get any error like this: enter image description here

add this following: You need to provide the chrome.exe location(in my case its 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe')

System.setProperty("webdriver.chrome.driver", "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe");

Upvotes: 1

Related Questions