# Set up web browsers and controls

Set up your browsers to enable the relevant Functional Testing agent extension, so that LeanFT can identify objects in your browsers.

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 and phantomjs.exe, 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.

It remains at all times the Customer’s sole responsibility to assess its own regulatory and business requirements. Micro Focus does not represent or warrant that its products comply with any specific legal or regulatory standards applicable to the Customer in conducting Customer's business.

In this topic:

## Set up Google Chrome for LeanFT

The first time you launch Chrome after installing LeanFT, you are prompted to enable the Functional Testing 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 | <LeanFT installation>\Installations\Chrome
   Linux / Mac | <LeanFT installation>/Installations/Chrome

   to the Extensions page, and click Add.

3. Make sure the Functional Testing Agent extension is enabled.

Back to top

## Set up Mozilla Firefox for LeanFT

The first time you launch Firefox after installing LeanFT, you are prompted to confirm the Functional Testing 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 | <LeanFT installation>\Installations\Firefox
   Linux / Mac | <LeanFT installation>/Installations/Firefox

   to the Firefox Extension page.

   Note: If you are using a Firefox version earlier than 57, the file names are FT.FirefoxAgent@hpe.com.xpi (Linux/Mac) and Agent.xpi (Windows).

3. When prompted, click Install Now.
4. Restart Firefox.

5. When finished, make sure the Functional Testing Agent extension is enabled.

Back to top

## Set up Internet Explorer for LeanFT (Windows only)

1. If you are prompted to enable the Functional Testing Agent, when you open Internet Explorer for the first time after you install LeanFT, click Enable.

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

2. In the Manage Add-ons window, make sure the Functional Testing Agent extension is enabled.

Back to top

## Set up Microsoft Edge for LeanFT (Windows only)

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

In order to ensure LeanFT communicates with Microsoft Edge via the Agent, you must ensure that the Microsoft WebDriver is present in the LeanFT 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 <LeanFT 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:

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

After your browsers are set up with the required extensions:

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

Back to top

## Set up PhantomJS for LeanFT

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

Windows | <LeanFT installation folder>\bin\PhantomJS\ | PhantomJS.exe
Linux | opt/leanft/bin/PhantomJS/ | PhantomJS_Linux32 PhantomJS_Linux64
Mac | /Applications/LeanFT/bin/PhantomJS | phantomjs_mac

Back to top

## Maintain headless Chrome's setup for LeanFT

By default, LeanFT 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 LeanFT, see the Product Availability 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 LeanFT is using in the following location:

Windows | <LeanFT installation folder>\bin\WebDriver\ | chromedriver.exe
Linux | opt/leanft/bin/WebDriver/ | chromedriver
Mac | /Applications/LeanFT/bin/WebDriver/ | chromedriver

Back to top

## Set up Safari (Mac only) for LeanFT

To install the Functional Testing Agent extension, do one of the following:

GUI | In <LeanFT installation>/Installations/Safari, double-click the Agent.safariextz When prompted, click Trust.
Terminal | Run the following command: `open –a safari /Library/Application Support/LeanFT/Agent.safariextz`

Note: If you are working with Safari 12, you must manually install the Functional Testing Agent Safari extension from the Safari Extension Gallery.

When finished, make sure the Functional Testing Agent extension is enabled.

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 LeanFT runtime engine can recognize the objects inside as Web objects.

You must register the browser control with LeanFT 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. Run the Register Browser Control Utility from <LeanFT installation folder>\bin\SettingNewBrowserControlApplication.exe.
3. Enter the path of the application containing the browser control and click Register.
4. Restart the LeanFT runtime engine.

If needed, you can run this utility again at a later time to unregister the browser control.

Back to top

## Working with Chromium-based embedded browser controls (Window only)

Note: Supported from LeanFT 14.51.

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

Set up the connection between LeanFT and the embedded browser

1. 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.

2. Connect LeanFT 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 LeanFT > Tools > Embedded Browser Connection.
   2. At the Embedded Browser Connection's prompt, enter the remote debugging port number and press ENTER. The tool sets up a connection between LeanFT and the embedded browser, using the port you specified.

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

   Whenever you restart the LeanFT run time engine, you must reconnect LeanFT 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 LeanFT 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.

   Create a step similar to the one below, in which we call the attach method before trying to highlight the browser.

   C#

       var browser = BrowserFactory.Attach(new BrowserDescription().Set("remoteDebuggerAddress", "localhost:<RemoteDebuggerPortNubmer>"));
       browser.Highlight();

   Java

       Browser browser = BrowserFactory.attach(new BrowserDescription.Builder().set("remoteDebuggerAddress","localhost:<RemoteDebuggerPortNubmer>").build());
       browser.highlight();

   JavaScript

       it("Should attach to browser control", function(done) {
            Web.Browser.attach({remoteDebuggerAddress: "localhost:<RemoteDebuggerPortNubmer>"}).then(function(browser) {
       		browser.highlight();
            });
            whenDone(done);
        });

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

Check your ChromeDriver version

Make sure that the ChromeDriver file LeanFT 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 Product Availability Matrix, find the ChromeDriver version provided by LeanFT.

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

Back to top

See also:

- Tips & tricks - Web testing

https://admhelp.microfocus.com LeanFT 8942
Tips to improve your search results...TOC Lean Functional Testing Help Center LeanFT Help Center 14.50 - 14.53 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version:(Undefined variable: _rscC_Basic_Variables.FloatingTocShow)