Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

How to Run Selence Directly Within the Server Using -htmlSuite

After you record test cases or test suite with Selenium IDE, you can run Selenese html files directly within the Selenium Server by passing the html file to the server's command line.

java -jar selenium-server-standalone-<version-number>.jar -htmlSuite "*firefox"
"http://www.google.com" "c:\absolute\path\to\my\HTMLSuite.html"
"c:\absolute\path\to\my\results.html"

For example, we have recorded a login test case and user setting change test case and saved it as a test suite  "SeleniumMasterLoginModuleSuite.html" file (see the screenshot below).

 

We can run the test by using the command below.

C:\selenium-java-2.39.0>java -jar selenium-server-standalone-2.39.0.jar -htmlSuite "*firefox"
"http://www.seleniummaster.com" "c:\SeleniumTestCase\SeleniumMasterLoginModuleSuite.html" "c:\SeleniumTestCase\results.html"

Here is the screenshot that shows that the test suite run with Firefox.

Test result indicated that test failed and test result is saved as results.html file in the c:\SeleniumTestCases folder.

results.html file contains the information below in the screenshot.