Set up web browsers and controls

Set up your browsers to enable the relevant Micro Focus UFT Agent extension, so that UFT Developer can identify objects in your browsers.

Note: If you have the Functional Testing Agent browser extension installed, you may need to manually remove this extension before enabling its new version, the Micro Focus UFT Agent extension. When you complete the set up, make sure you have only the latest extension installed.

If you want to test a non-Web application that contains a browser control, you must also register the browser control.

Caution: The instructions in this topic include downloading executable files from the Internet, such as chromedriver.exe, phantomjs.exe, and the WebView2 driver, which are not provided by Micro Focus.

We encourage you to use only genuine executable files from the official Chrome and PhantomJS Internet sites. Failing to comply with this recommendation may expose your system to increased security risks. Any and all associated risks are the Customer's responsibility and Micro Focus will not be held accountable for the same.

Set up Google Chrome for UFT Developer

The first time you launch Chrome after installing UFT Developer, you are prompted to enable the Micro Focus UFT Agent extension. Click Enable.

If the extension was not automatically installed:

  1. In the Chrome menu, select More Tools > Extensions.

  2. Drag the agent.crx file from:

    Windows <UFT Developer installation>\Installations\Chrome
    Linux / Mac <UFT Developer installation>/Installations/Chrome

    to the Extensions page, and click Add.

  3. Make sure the Micro Focus UFT Agent extension is enabled.

Back to top

Set up Mozilla Firefox for UFT Developer

The first time you launch Firefox after installing UFT Developer, you are prompted to confirm the Micro Focus UFT Agent extension. Click Allow and then click Continue.

If the extension was not automatically installed:

  1. In the Firefox browser menu, select Add-ons and then click Extensions.

  2. Drag the FT.FirefoxAgent@microfocus.com.xpi (Linux/Mac) or WebExtension.xpi (Windows) file from:

    Windows <UFT Developer installation>\Installations\Firefox
    Linux / Mac <UFT Developer installation>/Installations/Firefox

    to the Firefox Extension page.

  3. When prompted, click Install Now.
  4. Restart Firefox.
  5. When finished, make sure the Micro Focus UFT Agent extension is enabled.

Back to top

Set up Internet Explorer for UFT Developer (Windows only)

  1. If you are prompted to enable the Micro Focus UFT Agent when you open Internet Explorer for the first time after you install UFT Developer, click Enable.

    Otherwise, in Internet Explorer, select Tools > Manage add-ons.

  2. In the Manage Add-ons window, make sure the Micro Focus UFT Agent extension is enabled.

Back to top

Set up Microsoft Edge Chromium for UFT Developer (Windows only)

The first time you launch Edge Chromium after installing UFT Developer, you are prompted to enable the Micro Focus UFT Agent extension. Click Enable.

If the extension was not automatically installed:

  1. In the Edge Chromium menu, select Extensions.

  2. Enable Developer Mode.

  3. Click Load unpacked.

  4. Select the Extension folder from <UFT Developer installation>\Installations\Edge.

  5. Make sure the Micro Focus UFT Agent extension is enabled.

Back to top

Set up Microsoft Edge Legacy for UFT Developer (Windows only)

UFT Developer communicates with the Edge Agent for Functional Testing to test Web applications running in Edge Legacy browsers. This extension is part of the UFT Developer installation.

In order to ensure UFT Developer communicates with Microsoft Edge via the Agent, you must ensure that the Microsoft WebDriver is present in the UFT Developer installation folder:

  1. From the Microsoft WebDriver page, download the correct version of the WebDriver for your Microsoft Edge version.

    Recommended: Update the WebDriver version after performing Windows 10 updates, because Edge requires specific WebDriver versions for each Edge version.

  2. Copy the downloaded WebDriver.exe file to the <UFT Developer installation>\bin folder, and rename it MicrosoftWebDriver.exe.

  3. Open an Edge browser session together with Edge Agent for Functional Testing. You can do this in one of the following ways:

    • From the Start Menu:  Edge Agent for Functional Testing.

      For example, you would start Edge this way if you are working with the Object Identification Center (OIC) for Edge.

    • A BrowserFactory.Launch(BrowserType.Edge); statement.

    Note:  

    • UFT Developer cannot work with a session of Edge that was not opened with Edge Agent for Functional Testing.
    • For UFT Developer to work with the Edge Legacy browser, UAC must be enabled.

After your browsers are set up with the required extensions:

  • If the UFT Developer runtime engine or the OIC is open at the time you enable the agent for a browser, close and restart the UFT Developer runtime engine after the browsers are configured.
  • When you use UFT Developer to test Web applications, open your browser only after the UFT Developer runtime engine is active. UFT Developer does not recognize objects in browsers that were opened before the runtime engine.

Back to top

Set up PhantomJS for UFT Developer

To work with PhantomJS, you must install it in a specific location with a specific executable name:

Windows <UFT Developer installation folder>\bin\PhantomJS\ PhantomJS.exe
Linux /opt/uftdeveloper/bin/PhantomJS/

PhantomJS_Linux32

PhantomJS_Linux64

Mac /Applications/UFTDeveloper/bin/PhantomJS phantomjs_mac

Back to top

Maintain headless Chrome's setup for UFT Developer

By default, UFT Developer provides the ChromeDriver file that you need to work with headless Chrome. Over time, update this file to make sure that you are using a version that supports your Chrome version.

To find the ChromeDriver version provided by UFT Developer, see the Support Matrix. To check which Chrome versions this ChromeDriver supports, see http://chromedriver.chromium.org/downloads. When required, download the new version of the chromedriver binary file from this site and replace the one UFT Developer is using in the following location:

Windows <UFT Developer installation folder>\bin\WebDriver\ chromedriver.exe
Linux /opt/uftdeveloper/bin/WebDriver/

chromedriver

Mac /Applications/UFTDeveloper/bin/WebDriver/ chromedriver

Back to top

Set up Safari (Mac only) for UFT Developer

Install the Micro Focus UFT Agent extension for Safari and configure the browser communication port number to 8824: 

  1. Install and enable the extension:

    Install the Micro Focus UFT Agent extension from the Mac App Store (requires Apple ID sign-in).

    Enable the Micro Focus UFT Agent in Safari's Preferences > Extensions tab.

  2. Set the port number on which UFT Developer communicates with the Micro Focus UFT Agent extension:

    1. In the Applications folder, double-click Micro Focus UFT Agent.

    2. Modify the Safari port number to 8824. Ignore the rest of the settings in this window.

  3. Reopen Safari for the preferences to take effect.

Tip: By default, UFT One communicates with the Safari Micro Focus UFT Agent extension using port 8823. Therefore, you cannot run web tests on Safari from UFT One and UFT Developer on the same machine without adjusting the port number.

Back to top

Register Internet-Explorer-based embedded browser controls (Windows only)

If you have a non-Web application that hosts a browser control, you must register the control so that the UFT Developer runtime engine can recognize the objects inside as Web objects.

You must register the browser control with UFT Developer on any computer where you want to run your tests or use the OIC.

You register the control using the Register Browser Control Utility.

Note: This utility supports browser controls that are based on the Internet Explorer engine .

  1. Make sure UAC is disabled while using the utility or run the utility executable using Run As Admin.

  2. Use the Register Browser Control Utility in one of the following ways: 

    • Run <UFT Developer installation folder>\bin\SettingNewBrowserControlApplication.exe.

      Enter the path of the application containing the browser control and click Register.

    • Open a command window and run: 

      <UFT Developer installation folder>\bin\SettingNewBrowserControlApplication.exe/register "<path\browser-host-application.exe>"

      To unregister the browser control, replace register in the command with unregister.

  3. Restart the UFT Developer runtime engine.

If needed, you can run this utility again at a later time to unregister the browser control. (In the command line, replace register with unregister).

Back to top

Working with Chromium-based embedded browser controls (Windows only)

If you have a Desktop application that hosts a Chromium-based browser control, set up a connection between UFT Developer and the embedded browser so that UFT Developer can recognize objects in the browser. Chromium-based browser controls include, for example, JX browser, EO browser, Electron, WebView2, NW.js.

Before you set up the connection, make sure you have the correct web driver stored on your UFT Developer computer. For details, see Using different ChromeDriver versions.

Set up the connection between UFT Developer and the embedded browser

  1. Prepare the web driver.

    For CEF, Electron and JxBrowser applications

    The ChromeDriver is automatically installed with the UFT Developer installation.

    If a different version is required, see Using different ChromeDriver versions.

    For Microsoft Edge WebView2

    Download the WebView2 driver from the official website https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver.

    For NW.js

    Browse to https://nwjs.io/, and download the SDK, which includes the chromedriver.exe file.

    If you use a web driver file other than the one provided with UFT Developer, store it in an accessible location, and make note of this location for use in later steps. You download multiple versions and use them by specifying which driver file to use in the next steps.

  2. Configure your embedded browser to always open a port for remote debugging. Note the port number.

    Check your embedded browser's documentation for instructions on how to do this.

  3. Connect UFT Developer to the embedded browser:

    To enable designing tests

    1. On a computer where you want to use the OIC or Test Recorder, open your IDE and select UFT Developer > Tools > Embedded Browser Connection.

    2. At the Embedded Browser Connection's prompts enter the following information: 

      Remote debugging port number.

      mode: Enter MsEdgeWebView2 or nw.js if relevant, or press ENTER to set the default mode, which supports CEF, Electron, and JxBrowser.

      webdriverPath: If you placed your web driver in a non-default location, specify its path. Otherwise, press enter to use the default web driver location.

      The tool sets up a connection between UFT Developer and the embedded browser, using the port you specified.

    You can run the Embedded Browser Connection multiple times on the same computer to connect UFT Developer to multiple embedded browsers.

    Whenever you restart the UFT Developer run time engine, you must reconnect UFT Developer to the embedded browser again.

    To enable running test steps

    In your test, before any steps on the objects in the browser, add a BrowserFactory.Attach step (in JavaScript, Browser.attach) that connects UFT Developer to the embedded browser:

    • In the method's browser description parameter, provide a remoteDebuggerAddress capability that specifies the address and port number for remote debugging.

    • For WebView2 or NW.js, you must specify a mode, with the value MsEdgeWebView2 or nw.js.

      By default, UFT Developer assumes you are using CEF, Electron, or JxBrowser.

    • For WebView2 or NW.js, or if the web driver in stored in a non-default location, specify the location of the web driver to use for this embedded browser control.

      This is useful if you cannot replace files in the default location, or if you want to use multiple web drivers in parallel.

    Create a step similar to the one below to call the attach method:

    For details on the Attach method, see the .NET, Java, and JavaScript SDK References.

Using different ChromeDriver versions

Make sure that the ChromeDriver (or Edge Driver) file UFT Developer is using supports the Chromium version of your embedded browser control.

  1. Check which Chromium version your embedded browser is based on.
  2. At http://chromedriver.chromium.org/downloads, check which ChromeDriver versions support your embedded browser's Chromium version.
  3. In the Support Matrix, find the ChromeDriver version provided by UFT Developer.

If required, download the necessary version of the chromedriver binary file from http://chromedriver.chromium.org/downloads and replace the one UFT Developer is using here: <UFT Developer installation folder>\bin\WebDriver\chromedriver.exe

If you cannot replace this file for any reason, or if you want to use multiple ChromeDrivers in parallel, place your driver file in an accessible location, and specify this location in the attach step that you use to connect UFT Developer to the embedded browser.

Back to top

Manually update browser policies to allow Micro Focus UFT Agent extension installation

If the extension fails to install due to your browser policy or if you didn't select the Set Chrome, Chromium Edge, Firefox options option during installation, manually allow the installation by performing the following changes: 

Caution: Make sure that your company's security policies permit you to make this change.

Chromium Edge

Chrome

Back to top

See also: