How do I launch the Selenium IDE from the command line with a specific test case loaded? How do I launch the Selenium IDE from the command line with a specific test case loaded? google-chrome google-chrome

How do I launch the Selenium IDE from the command line with a specific test case loaded?


You are close. Selenium has a built-in page to auto load and execute tests from a test-suite called TestRunner.html. You can invoke it like follows :

C:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content/selenium-core/TestRunner.html?baseUrl=http://[BASEURL]&test=file:///[TESTSUITE-PATH]&auto=false"

This will fireup firefox with all tests from the test-suite at the specified path loaded up and waiting to execute in a single button press.

For example

After creating a couple of selenium tests, save the test cases as testcase1.html and testcase2.html in a folder say c:\tests.

Save the test suite as testsuite.html in the same folder. Now you can launch these suite of tests with the below command line :

C:\Program Files\Mozilla Firefox\firefox.exe" -chrome "chrome://selenium-ide/content/selenium-core/TestRunner.html?baseUrl=http://localhost&test=file:///C:\tests\testsuite.html&auto=false"

You should have the tests loaded up in firefox ready to execute.

If you change the above url to have auto parameter to true, then it will run the tests as well after launch.

&auto=true

EDIT :

Updated baseurl argument to proper case sensitive form: baseUrl

Updated path to TestRunner.html to: chrome://selenium-ide/content/selenium-core/TestRunner.html


If you want to run a testsuite with firefox from the commandline, you have to start run java, not firefox.Like this:

C:\Program Files (x86)\Java\jre6\bin\java.exe" -jar c:\seltest\selenium-server-standalone-2.18.0.jar -htmlSuite "*firefox" "http://127.0.0.1" "c:\seltest\mytestsuite.html" "c:\seltest\logs\results-firefox.html" -port 5555

-- Freek Borgerink