Running a Web UI test

To verify that a web application works as designed, run the test in a browser. Optionally, you can run the test in more than one browser at a time to speed up your test effort. Before running the test, you can choose to use a specific browser profile for the test.

Before you begin

  • For Apple® Safari® 7.1 or later: Ensure that you have manually enabled the browser for recording Web UI tests. For instructions, see Enabling the Apple Safari browser to perform Web UI tests on macOS.
  • To record and play back a test with the Mozilla Firefox and Google Chrome browsers on the Mac operating system, ensure that you have installed the browsers at the default location /Applications.
  • Starting with 9.1.1, you can run a test that was recorded in Google Chrome Device Mode. This allows you to emulate tests of web apps on mobile devices. See Recording a test with Google Chrome Device Mode and Running a test recorded in Google Chrome Device Mode.
  • Also starting with 9.1.1, you can play back tests in Chrome Headless Mode. This allows you to run tests in an automated testing environment where a visible user interface shell is not required. See Running a test in Google Chrome headless mode.
  • Starting with 9.2.1, you can use industry-standard mobile browsers, such as Chrome and Safari, to run Web UI tests for mobile web applications. You can run tests with Chrome on Android devices and emulators and with Safari on iOS devices and simulators. This capability uses Appium to actually run the tests. Before 9.2.1, mobile Web UI tests could only be run in the generic browser that is bundled with Rational® Functional Tester
    Note: If you want to run a test on Chrome, you must have installed the appropriate version of Chrome driver for Appium.
    .

About this task

To use a specific browser profile for the test, see Using alternate browser profile for test playback.

You can run a Web UI test in the same web browser that was used for the recording or run the test in other web browsers. You can even run a Web UI test in several browsers simultaneously. You can also run the test as part of keyword execution from IBM® Rational® Quality Manager, as part of compound test, or from the Command Line Interface (CLI).

You can run a test that was recorded in Google Chrome Device Mode. This allows you to emulate tests of web apps on mobile devices. See Recording a test with Google Chrome Device Mode and Running a test recorded in Google Chrome Device Mode. You can also play back tests in Chrome Headless Mode. This allows you to run tests in an automated testing environment where a visible user interface shell is not required. See Running a test in Google Chrome headless mode.

You can play back the Web UI tests by using browsers such as Microsoft Edge Chromium and Opera browsers on computers that are running on Windows or Mac operating systems.
Note: When you install the Opera browser on your computer, you must select All users on this computer in the Install for drop-down list. Otherwise, the Opera browser is not displayed in the list of browsers that are available for selection to play back the Web UI tests.

When you run a test, the steps in the test looks for the UI objects over and over again until they get the object or timeout. For example, if the step is to click a button with the name Submit, the test will look for the button with that name. If the name of the button changed, the test will keep looking for the button and then timeout. By default, the timeout is set to 10s. You can modify this value for the steps or at the test level. If you modify the timeout value in the step, that value takes precedence over the timeout value specified at the test level.

Web UI tests that were recorded in Internet Explorer, Firefox or Chrome can be played back with the Microsoft Edge browser, but you cannot record them in Microsoft Edge.
Note: If a test includes an action to open a new browser window from the existing window and the URL or the title of the new browser window changes dynamically at every run time and does not matches with the one in the test, the playback of the test fails. If either the URL or the title of the new browser window is constant, use that in the test and remove the other one. For example, if the URL dynamically changes at run time but the title of the window remains same, ensure that the test only includes the title of the window.

Procedure

  1. To open a test, double-click it in the Test Navigator view.
  2. In the Test editor, click Run Test. to run an individual test or Run Compound Test to run a compound test.
  3. In the Run Configuration dialog box, in the Run using column, select the web browser on which to run the test. Optionally, click Run on several devices and browsers in parallel and select the devices and browsers on which to run the test.
    Notes:
    • If the packaged drivers for the Google Chrome, Microsoft Edge, and Opera browsers are not compatible with the browsers installed on your computer, during the playback, a link is provided in the Run Configuration dialog box. You can click the link to install the appropriate driver and then continue with the playback of tests.
    • When you play back Web UI tests on a remote computer, you can choose to automatically resolve the browser and driver incompatibility of the Google Chrome, Edge, and Opera browsers by selecting the Fix the browser driver incompatibility checkbox.
    • Only those web browsers that are installed on your computer and supported by the Web UI extension are displayed in the list. To run a web test on a mobile device or emulator, the device must be connected and must be in the passive mode.
  4. Click Finish.
    The selected web browser opens and the test is played back. Do not perform any action on the web browser while the test is playing back. The statistical and live reports show the live data as the test is played back.

Results

After the test run completes, the unified report, statistical report, and the test log are displayed. When running the test in multiple browsers, a single report is displayed for all browses. To view a functional report, you must generate it manually by right-clicking a report in the Results folder and clicking Generate Functional Test Report. The Resources tab in the statistical report is empty because a Web UI test does not monitor resources.