Enabling the Apple Safari browser to perform Web UI tests on macOS

You can record and play back Web UI tests in the Apple Safari browser to test the web applications. To record Web UI tests in the Safari browser, you must first enable the browser and then record tests.

About this task

The Safari browser is ready to record Web UI tests after you enable the remote automation feature and install the Web UI extension. The Safari browser is ready to play back Web UI tests immediately after you enable the remote automation feature.
Notes:
  • The installation of Web UI extension is required only for recording and not for playing back of Web UI tests.
  • You can record tests on the web applications in Safari 12 only.

Procedure

  1. Enable the remote automation feature by performing the following tasks:
    1. Click Safari > Preferences > Advanced tab, and then select the Show Develop Menu checkbox.
    2. Click the Develop menu, and then select Allow Remote Automation.
    3. Authorize the safaridriver to launch the webdriverd service, which hosts the local web server, by running the following command manually /usr/bin/safaridriver.
    4. Complete the authentication process.
  2. Install the Web UI extension for the Safari browser by performing the following tasks:
    1. Click Extension Builder in the Develop menu.

      The Extension Builder dialog box is displayed.

    2. Click the plus icon, and then click Add Extension.
    3. Navigate to the WebUISafari12.safariextension folder within the shared installation directory. For example, <IMShared>/plugins/com.ibm.rational.test.rtw.webgui.browextension.safari_<version string>/WebUISafari12.safariextension.
    4. Click Select, and then click Run after the extension is added.
    Note: The extension that is added in the Safari browser expires immediately after you quit the Safari browser. You must add the extension again to enable the Safari browser to record the tests.
  3. Verify whether the extensions are installed and the browser is enabled by performing the following steps:
    1. Open the Safari browser.
    2. Click Safari > Preferences > Extensions.

      The added extension is displayed on the Extensions page.

Results

The Safari browser is enabled for recording and playing back Web UI tests.

What to do next

You can now record or play back a Web UI test in the Safari browser.