views:

1750

answers:

3

When I use Selenium IDE that is extension of Firefox.

After that I save some test case from Selenium IDE.

Now I want to use command line to run this test case file.

I try to do follow this how-do-i-launch-the-selenium-ide-from-the-command-line-with-a-specific-test-case but it not work.

Please help me.

+2  A: 

You will need the Selenium RC which you can get from:
http://seleniumhq.org/download/

and Java 1.5 or higher (sorry I'd post a link to it, but Stack Overflow will only let me post one link as I am a new user)

1) Install Java
2) Unpack Selenium RC.
3) Open a cmd.exe window and go to the directory containing the Selenium Server (selenium-remote-control-1.0.1\selenium-server-1.0.1)
4) Run the command below:

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

This should run your test suite in Firefox and write the results to the html file. Obviously you will need to change the "http://10.8.100.106" argument to your own server (this might just be localhost / 127.0.0.1)

Hope this helps.

Jamie McNaught
he wants to run a specific test though
AutomatedTester
Ok, sorry I missed that little detail!<br><br>Well in that case they should create a new testsuite HTML file containing just the single test html that they want to run. Probably just take an existing testsuite html file split it into a notiional header and footer parts and then write a simple piece of code to concatenate the header, the test name and the footer together, then run that through the command I gave in my answer.<br><br>neokain> What language are you familiar with and I'll try and write a fuller example.
Jamie McNaught
Opps... comments don't support HTML tags! Sorry!
Jamie McNaught
A: 

Here is an article that explains you step-by-step process of how to run Selenium RC application in Java.

Create a Java Selenium RC test script and executing the script

Pavandeep Puddupakkam
A: 

Thansk Jamie for your answer,

I've tried your suggestion and it works.

However, let's say my suite needs two or more domains. How do I handle this in the command line ? In the sample you provided there is only one domain (("http://10.8.100.106") And when I tried to run a suite that contain 2 test cases with different domains - the first one succeed but the second TC failed due to wrong domain name (base url).

Thanks, Yaniv

yanivki