Ranorex Studio’s Selenium WebDriver integration allows you to run web tests on different browsers, operating systems, and machines without additional plugins.
Quick Start Guide
Follow these steps to integrate Selenium WebDriver with Ranorex Studio for web testing:
- Prepare the Selenium WebDriver environment.
Ensure you have the necessary browser drivers or a Selenium Grid set up for your target browsers. - Start a Selenium WebDriver service.
- Add a WebDriver endpoint in Ranorex Studio:
- Open Ranorex Studio and navigate to the Endpoints panel.
- Click Add endpoint, then select WebDriver.
- Provide a name for the endpoint and the WebDriver server address:
For a local Selenium Grid, this is typically http://localhost:4444.
For remote Selenium grids, use the hub URL given (often in the format https://<cloud-hub>/wd/hub). - Click Test connection to verify Ranorex can reach the WebDriver endpoint, then click Add to save it. The new endpoint will appear in the list.
- Record or create your web test on your local machine or use an existing one.
- Review the web test following these guidelines.
- Set the WebDriver endpoint as the automation root.
- Run the test suite.
Setting up a Selenium WebDriver infrastructure
To integrate with Selenium 4, configure your environment as follows:
- Java (for Selenium Grid): If you plan to use Selenium Grid or the Selenium server JAR, ensure you have Java 11 or higher installed on the machine (Not needed if you only use local browser driver executables.)
- Selenium Server: Download the latest version of Selenium and place it into a folder.
- Browser Drivers: Each browser requires a WebDriver binary. Selenium 4 introduces Selenium Manager, which can automatically download and manage browser drivers when a session starts.
Running and Adjusting Web Tests for Selenium WebDriver
With the environment and endpoints set, you can now run your recorded test on the WebDriver endpoint:
- Start the server before adding an endpoint or running a test, also, ensure the WebDriver endpoint is selected as the execution target.
- Remove all actions and repository items that interact with the web browser application itself.
-
Close the browser, and ensure your test ends by closing the browser through WebDriver.
The recommended way is to use the Close Application action on the browser application in Ranorex (this translates to a WebDriver .quit() call to terminate the session). This ensures the browser process on the remote end is closed and the session is freed on the Selenium server.