Connect to a remote Mac computer

This task describes how to control the UFT connection to a remote Mac computer, to enable testing Web applications on the Safari browser.

For details on how to work with a connected remote computer and how UFT handles connection attempts when a previous connection exists, see Working with Apple Safari on a remote Mac computer.

Prerequisite

To test Web applications on the Safari browser, install the UFT Connection Agent and the Unified Functional Testing Agent Safari browser extension on your Mac computer. For details on how to do this, see The UFT Connection Agent for Mac computers.

Back to top

Control the connection to the Mac while designing your test

  • Click the Remote Connection button in UFT's toolbar.

    In the dialog that opens, enter the host name or IP Address to use for the Mac.

    Optionally, append a port number to the host name. For details, see Configure the Port Number to Use for the UFT-Mac Connection.

  • If the UFT Connection Agent on the Mac is configured to expect an SSL connection,you must select the Use SSL option.

    To use an SSL connection to secure the communication between UFT and the Mac, make sure that the relevant certificates and key are defined in the Options dialog box in UFT (Tools > Options >GUI Testing > Remote Connection) and in the UFT Connection Agent preferences on the Mac. For details, see the Securing the communication with the remote Mac computer.

  • Use the Connect/Disconnect button on this dialog to control the connection status while you edit the test.

  • This dialog also displays the current status of the connection.

  • Before you run the test, make sure that you use one of the methods below to set up the UFT-Mac connection for the run session.

Back to top

Specify the remote Mac computer to use for running the test/component

Do one of the following:

  • Select Record > Record and Run Settings to open the Record and Run Settings dialog box.

    1. In the Web tab, select Open the following browser when a record or run session begins.

    2. Select Apple Safari (on remote Mac computer) from the list of browsers.

    3. Set the host (and port) information.

    4. Select whether to initiate an SSL connection.

    5. Select whether to disconnect from the Mac at the end of the run session, and whether to close the browser.

  • Set the environment variables REMOTE_HOST, BROWSER_ENV, URL_ENV, and USE_SSL (the last two being optional).

    In these environment variables, you specify the Mac connection details, the SAFARI browser, and, optionally, the URL to open in the browser.

    If you need an SSL-secured connection, set the USE_SSL variable to TRUE. For details, see Environment variables for a Web-based environment.

UFT sets up the connection with the specified Mac and runs the Safari browser at the beginning of the run session, whether the test runs it from UFT’s UI, or from an ALM test set.

Back to top

Add steps for remote connection

Use the RemoteConnection utility object and its methods: Connect (hostname, [useSSL]), Disconnect, IsConnected to set up and disconnect the connection with the Mac.

Use RemoteConnection.Run (Safari, <URL>), to run the Safari browser on the remote Mac after you establish the connection.

For details, see the Utility Objects section of the UFT Object Model Reference for GUI Testing.

Back to top

Configure the Port Number to Use for the UFT-Mac Connection

By default, UFT connects to the Mac using port 8822. However, in some situations, you might want to use a different port. For example:

  • If another application on the Mac uses this port.

  • If multiple UFT users need to connect to the same Mac computer. Each UFT user can use a connection agent installed under a different Mac user account, with a different port number configured.

To use a different port, append the port number to the host name: <hostname>:<port number>.

Make sure to configure the same port number on the Mac, in the UFT port option in the UFT Connection Agent preferences.

Back to top