LiquidTest and Selenium RC have some unique capabilities that help to streamline the test creation process. Selenium tests recorded with LiquidTest can be replayed/run on any standard Selenium infrastructure. Existing Selenium tests either manually created or created by Selenium IDE can be replayed/run with LiquidTest (including LiquidTest server component).
There are multiple ways to execute LiquidTest generated tests in Selenium RC/Server (download Selenium RC). The Selenium test can be run in the RC/Server but executed from within your Eclipse Development Environment. This has several benefits, but in a nutshell, it keeps the execution process clean whilst you develop your tests.
Steps:
1 - Open your Selenium Test in LiquidTest
2 - Check the port that you are running your tests on (show code for this)
@Before
public void setUp() {
// Port is the second parameter passed to DefaultSelenium - note changed to 4445
selenium = new DefaultSelenium("localhost", 4445, "*firefox", "http://localhost/");
selenium.start();
}
3 - Either change the port or disable the LiquidTest runner (Window → Preferences → LiquidTest → Selenium → Enable RC Server) which listens on the same port as Selenium RC (remember it is the specification that dictates the port).
Note that the port that LiquidTest listens on for Selenium Test executions can be changed in 'Window → Preferences → LiquidTest → Selenium' to any port that you deem appropriate.
4 - Start Selenium RC/Server on the desired port.
Run the following on your command line in the directory that your Selenium RC is located.
If you are running Windows 7 (or Vista), to save hours of frustration ensure that you start the Selenium server as Administrator. This can be done by running a Command Prompt as Administrator and then executing the Selenium server start command below.
java -jar selenium-server-standalone-2.0b2.jar -port 4445
5 - Right click in Eclipse and “Run as JUnit” - this will run your Selenium test in the Selenium RC environment assuming that the port set in your Selenium test matches the port that Selenium RC is running on (steps 2 and 4).
Sit back and watch the test run and results reporting back into your IDE..
Selenium RC/Server running your LiquidTest recorded test case
The results from the test run..
Tip - If you want to run your tests alternating between the default LiquidTest runner (within the IDE) and the external Selenium RC, you can change the port when you start Selenium RC or change the port that LiquidTest executes Selenium tests on.