Guest blog post by Sauce user Adam Lemisch
After learning you can’t easily use tests created in Selenium IDE (in HTML format) with Selenium RC to point tests at multiple browsers, I figured I had no choice but to rush out and learn a scripting language.
But after some research, I came across Sauce Labs, and realized it was THE perfect jump off point for me. I could use Sauce IDE to generate the tests I needed, point Sauce RC at the HTML files that contained the test steps, and run those tests against different browsers.
The following will guide you through the process of utilizing Sauce RC to run HTML tests created in Sauce IDE.
After you’ve played with/learned Sauce IDE and have a test you want Sauce RC to handle, you will have to save the “test case” and “test suite” as HTML files in order for Sauce RC to work with them.
This is where the issues began…
Saving the “Test Case” CORRECTLY:
1. From the Sauce IDE “File” menu, select “Save Test Case” or “Save Test Case As…”
2. Navigate to the directory that you wish to save your test case in.2a. Make sure that you manually add the “.html” extension to the file name.2b. Make sure that you select the “HTML Files” option from the “Save as type:” box.
You’re done saving the “Test Case” portion of the files required. Next, we save the “Test Suite” files in pretty much the exact same way.
Saving the “Test Suite” CORRECTLY:
1. From the Sauce IDE “File” menu select “Save Test Suite” or “Save Test Suite As…”
2. Navigate to the directory that you wish to save your test suite in.2a. Make sure that you manually add the “.html” extension to the file name.2b. Make sure that you select the “HTML Files” option from the “Save as type:” box.
You’re done saving the “Test Case Suite” portion of the files required.
Next we move on to showing Sauce RC where to find the files to run from. (If you know a little about HTML, you can look at the two files you just saved in an HTML editor. You will see that the TestSuite.html file is linking to the TestCase.html file.)
Showing Sauce RC where the files are CORRECTLY:
1. On the “HTML Suite” tab of Sauce RC we are going to fill in the required information.
1a. “Suite File” must be filled in with the exact path to the file we designated in the second step titled, “Saving the “Test Suite” CORRECTLY:”
1b. “Result File” must contain a path to a directory WITH a file name at the end of the path that includes the “.html” extension. If you simply input the path and FULL filename, Sauce RC will create the “Result File” for you at run time.
1c. “Start URL” must match what’s in your test case.
1d. “Browser” – well that’s just self explanatory…
The following screenshot is an example.
So, there you have it! You should be able to hit run and watch as Sauce RC runs through your test script in the selected browser. Hopefully this helps, and if you run into any issues and get other answers, please share in the Sauce forums. Chances are we’re all looking for an answer when we are just starting out!