This tutorial walks you through a simple web test from start to finish: create a web test solution, record a few actions, add a validation, run the test, and review the report.
Test definition
Your test contains 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.
Create a new web test
- On the Ranorex Studio Start Page, click New test solution using wizard… or go to File > New > Solution using wizard…
- Select Web..
- Follow the wizard instructions:
- Name your solution (example: WebTest).
- Select a browser (the example uses Firefox).
- Set the URL to the sample web testing page: www.ranorex.com/web-testing-examples/
-
For recording behavior, choose:
- 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 you are going to interact with desktop applications and want this in your test, select Do not use whitelisting.
- Click Finish. Ranorex Studio opens the prepared solution.
The prebuilt web test looks like this:
- Test suite view: This is where you build and control your tests.
- The solution includes a test suite project with 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.
Record the test
Before recording, ensure the selected browser is open, and the sample URL is already loaded www.ranorex.com/web-testing-examples/. Don’t record these steps if the project already includes them in the prepared modules
- In the recording module view, click RECORD. Ranorex Studio minimizes.
- The Recorder control panel appears in the bottom right.
Validate the logo
- In the Recorder control panel, click Validate.
- Select the Ranorex Studio logo and click it when the purple frame surrounds it.
- 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.
Open and confirm the dialog window
- 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.
Results
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.
Run the test and review the report
Let’s run the test and review the test run report.
- Close all instances of Firefox.
- Click the tab
WebTest.rxtstto switch to the test suite view and click RUN.
Report
Once the test run has finished, the report displays. In our case, it should look like this: