In this chapter, you’ll learn how to build a simple web test from start to finish, including recording the test, running it, and viewing the test run report.
In this chapter
Our test will contain the following steps:
Start the browser and open the URL www.ranorex.com/web-testing-examples/
Check if the Ranorex Studio logo is displayed at the top.
Click Open dialog.
Click OK to confirm and close the dialog window.
Close the browser.
We’ll create a new web test using the ⇢ RocketStart wizard.
On the Ranorex Studio Start Page, click New test solution using wizard… or go to File > New > Solution using wizard…
Follow the instructions of the wizard. Name your solution WebTest. When prompted, select Mozilla Firefox as your browser (make sure it’s installed on your computer) and specify www.ranorex.com/web-testing-examples/ as the URL.
When asked to select the recording behavior, select Add browsers to whitelist, as our test will only cover interactions with the previously selected browser. If we were going to interact with desktop applications and wanted this in our test, we’d select Do not use whitelisting.
On the final screen, click Finish. Ranorex Studio will then open the prepared solution.
The prebuilt web test will look like this:
Test suite view
This is where you build and control your tests.
The solution comes with a test suite project that contains a simple prebuilt test suite structure. It contains a test case with three recording modules: OpenBrowser, which starts the browser and navigates to the URL; Recording1, which is empty and ready for you to record test actions; and CloseBrowser, which closes the browser.
Recording module view
In the recording module view of Recording1, you can record and manage test actions.
Empty actions table
This is where your recorded actions appear.
Before you start recording, make sure Firefox is running and the URL www.ranorex.com/web-testing-examples/ is opened. Don’t record these steps. They are already included in the prebuilt project.
Once that’s done, you can start recording.
In the recording module view, Click RECORD. Ranorex Studio is minimized.
The Recorder control panel appears in the bottom right.
In the control panel, click Validate.
Mouse over the Ranorex Studio logo and click it when the purple frame surrounds it as in the screenshot.
The Select element window opens. Check if the correct image has been selected and click Next to confirm.
The Validation settings open. We’re checking that the logo exists and is visible. Both of these attributes should already be selected. Click OK to confirm.
In the browser, click Open dialog. A simple dialog window opens.
Click OK to confirm and close the dialog.
Finally, in the Recorder control panel, click Stop to finish the recording.
The control panel disappears and Ranorex Studio comes back into focus, showing the following:
Action table with three recorded actions.
Repository with repository items referencing the three UI elements interacted with during the recording.
Let’s run the test and review the test run report.
Close all instances of Firefox.
Click the tab WebTest.rxtst to switch to the test suite view and click RUN.
Once the test run has finished, the report will appear. In our case, it should look like this:
A detailed view of the test case shows that all actions were executed successfully.
Reports are explained in
Ranorex Studio fundamentals > ⇢ Reporting