1

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.

2 Answers 2

1
  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"); 
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your anwser, Helped a lot. But I can't make the last part work. I tried with Mozilla and Chrome, both get open when I launched the test but nothing happen and test failed with a time out or by saying unable to connect. Is there something to do with the navigators ?
For Chrome: System.setProperty("webdriver.chrome.driver", "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"); This did not work for me. It only opened Google Chrome, but it did not show desired URL (URL was not typed in address bar)
Download ChromeDriver (chromedriver.exe) and use the following code: System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.