Set up web browsers and controls
Set up your browsers to enable the relevant OpenText UFT Agent extension, so that OpenText Functional Testing for Developers 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, phantomjs.exe, and the WebView2 driver, which are not provided by OpenText.
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 OpenText will not be held accountable for the same.
Browser extension compatibility
When using the OpenText UFT Agent browser extension, be aware of the following:
-
Previous versions of UFT Developer used the Functional Testing Agent browser extension. If you have this extension installed, you may need to manually remove it before enabling the new OpenText UFT Agent extension. When you complete the set up, make sure you have only the latest extension installed.
-
ValueEdge Functional Test Design (FT Design) also uses the OpenText UFT Agent to test web applications. FT Design and OpenText Functional Testing for Developers each install their own version of the extension, and each program requires its version to be the only one enabled.
Before you use OpenText Functional Testing for Developers on a computer that also used FT Design, make sure the extension version enabled matches your version of OpenText Functional Testing for Developers.
Set up Google Chrome for testing
The first time you launch Chrome after installing OpenText Functional Testing for Developers, you are prompted to enable the OpenText UFT Agent extension. Click Enable.
If the extension was not automatically installed:
-
In the Chrome menu, select More Tools > Extensions.
-
Drag the agent.crx file from:
Windows <Installdir>\Installations\Chrome Linux / Mac <Installdir>/Installations/Chrome to the Extensions page, and click Add.
The Chrome folder contains additional sub folders for you to select.
-
Select v3 for the Manifest V3 (MV3) extension, built for the most recent versions of Chrome.
-
For Chrome version 94 or earlier, which does not support MV3 extensions, select the v2 folder.
-
-
Make sure the OpenText UFT Agent extension is enabled.
Note: In some cases, when you restart the browser, the newly installed extension reverts to a previously installed version.
Workaround: Try deleting the following folder, restarting the browser, and installing the new extension again: %LOCALAPPDATA%\Local\Google\Chrome\User Data
Set up Mozilla Firefox for testing
The first time you launch Firefox after installing OpenText Functional Testing for Developers, you are prompted to confirm the OpenText UFT Agent extension. Click Allow and then click Continue.
If the extension was not automatically installed:
-
In the Firefox browser menu, select Add-ons and then click Extensions.
-
Drag the FT.FirefoxAgent@microfocus.com.xpi (Linux/Mac) or WebExtension.xpi (Windows) file from:
Windows <Installdir>\Installations\Firefox Linux / Mac <Installdir>/Installations/Firefox to the Firefox Extension page.
- When prompted, click Install Now.
- Restart Firefox.
-
When finished, make sure the OpenText UFT Agent extension is enabled.
Set up Internet Explorer for testing (Windows only)
-
If you are prompted to enable the OpenText UFT Agent when you open Internet Explorer for the first time after you install OpenText Functional Testing for Developers, click Enable.
Otherwise, in Internet Explorer, select Tools > Manage add-ons.
-
In the Manage Add-ons window, make sure the OpenText UFT Agent extension is enabled.
Set up Microsoft Edge for testing
The first time you launch Edge after installing OpenText Functional Testing for Developers, you are prompted to enable the OpenText UFT Agent extension. Click Enable.
If the extension was not automatically installed:
-
In the Edge browser's menu, select Extensions.
-
Enable Developer Mode.
-
Click Load unpacked.
-
Select the Extension folder from <Installdir>\Installations\Edge.
The Edge folder contains additional sub folders for you to select.
-
Select v3 for the Manifest V3 (MV3) extension, built for the most recent versions of Edge.
-
For Edge version 94 or earlier, which does not support MV3 extensions, select the v2 folder.
-
-
Make sure the OpenText UFT Agent extension is enabled.
Note: In some cases, when you restart the browser, the newly installed extension reverts to a previously installed version.
Workaround: Try deleting the following folder, restarting the browser, and installing the new extension again: %LOCALAPPDATA%\Local\Microsoft\Edge\User Data
Set up PhantomJS for testing
To work with PhantomJS, you must install it in a specific location with a specific executable name:
Windows | <Installdir>\bin\PhantomJS\ | PhantomJS.exe |
Linux | /opt/uftdeveloper/bin/PhantomJS/ |
PhantomJS_Linux32 PhantomJS_Linux64 |
Mac | /Applications/UFTDeveloper/bin/PhantomJS | phantomjs_mac |
Maintain headless Chrome's setup for testing
By default, OpenText Functional Testing for Developers 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 OpenText Functional Testing for Developers, 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 OpenText Functional Testing for Developers is using in the following location:
Windows | <Installdir>\bin\WebDriver\ | chromedriver.exe |
Linux | /opt/uftdeveloper/bin/WebDriver/ |
chromedriver |
Mac | /Applications/UFTDeveloper/bin/WebDriver/ | chromedriver |
Set up Safari (Mac only) for testing
Install the OpenText UFT Agent extension for Safari and configure the browser communication port number to 8824:
-
Install and enable the extension:
Install the OpenText UFT Agent extension from the Mac App Store (requires Apple ID sign-in).
Enable the OpenText UFT Agent in Safari's Preferences > Extensions tab.
-
Configure the extension settings:
-
In the Applications folder, double-click OpenText UFT Agent.
-
Set the port number on which OpenText Functional Testing for Developers communicates with the OpenText UFT Agent extension:
Modify the Port (or Safari Port) number to 8824.
-
Set the Mode to UFT Developer.
-
Ignore the rest of the settings in this window.
-
-
Reopen Safari for the preferences to take effect.
Tip: By default, OpenText Functional Testing communicates with the Safari OpenText UFT Agent extension using port 8823. Therefore, you cannot run web tests on Safari from OpenText Functional Testing and OpenText Functional Testing for Developers on the same machine without adjusting the port number.
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 OpenText Functional Testing for Developers runtime engine can recognize the objects inside as Web objects.
You must register the browser control with OpenText Functional Testing for Developers on any computer on which 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 .
-
Make sure UAC is turned off while using the utility or run the utility executable using Run As Admin.
-
Use the Register Browser Control Utility in one of the following ways:
-
Run <Installdir>\bin\SettingNewBrowserControlApplication.exe.
Enter the path of the application containing the browser control and click Register.
-
Open a command window and run:
<Installdir>\bin\SettingNewBrowserControlApplication.exe/register "<path\browser-host-application.exe>"
To unregister the browser control, replace
register
in the command withunregister
.
-
-
Restart the OpenText Functional Testing for Developers 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
).
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 OpenText Functional Testing for Developers and the embedded browser so that OpenText Functional Testing for Developers 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 OpenText Functional Testing for Developers computer. For details, see Using different ChromeDriver versions.
Set up the connection between OpenText Functional Testing for Developers and the embedded browser
-
Prepare the web driver.
For CEF, Electron and JxBrowser applications The ChromeDriver is automatically installed with the OpenText Functional Testing for Developers installation.
If a different version is required, see Using different ChromeDriver versions.
For Microsoft Edge WebView2 Download the WebView2 driver from the official website.
For NW.js Download the NW.js SDK, which includes the chromedriver.exe file.
If you use a web driver file other than the one provided with OpenText Functional Testing for Developers, 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.
-
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.
-
Connect OpenText Functional Testing for Developers to the embedded browser:
To enable designing tests
-
On a computer on which you want to use the OIC or Test Recorder, open your IDE and select OpenText Functional Testing for Developers > Tools > Embedded Browser Connection.
-
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 OpenText Functional Testing for Developers and the embedded browser, using the port you specified.
You can run the Embedded Browser Connection multiple times on the same computer to connect OpenText Functional Testing for Developers to multiple embedded browsers.
Whenever you restart the OpenText Functional Testing for Developers run time engine, you must reconnect OpenText Functional Testing for Developers 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 OpenText Functional Testing for Developers 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, OpenText Functional Testing for Developers 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:
C#Copy codeBrowserDescription browserDescription = new BrowserDescription();
browserDescription.Set("remoteDebuggerAddress", "localhost:9222");
browserDescription.Set("mode", "nw.js");
browserDescription.Set("webdriverPath", "C:\\Users\\leanft\\Downloads\\nwjs-sdk-v0.55.0-win-x64\\chromedriver.exe");
IBrowser browser = BrowserFactory.Attach(browserDescription);JavaCopy codeBrowser browser = BrowserFactory.attach(new BrowserDescription.Builder().set("remoteDebuggerAddress", "localhost:9222")
.set("mode","MsEdgeWebView2")
.set("webdriverPath","C:\\Users\\leanft\\Downloads\\edgedriver_win64\\msedgedriver.exe")
.build());JavaScriptCopy codeWeb.Browser.attach({
"remoteDebuggerAddress": "localhost:9222",
"mode": "default",
"webdriverPath": "C:\\Users\\leanft\\Downloads\\chromedriver_win32\\chromedriver.exe"
}).then(function(launched_browser){
browser = launched_browser;
});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 OpenText Functional Testing for Developers is using supports the Chromium version of your embedded browser control.
- Check which Chromium version your embedded browser is based on.
- On the ChromeDriver Downloads page online, check which ChromeDriver versions support your embedded browser's Chromium version.
- In the Support Matrix, find the ChromeDriver version provided by OpenText Functional Testing for Developers.
If required, download the necessary version of the chromedriver binary file from ChromeDriver website, and replace the one OpenText Functional Testing for Developers is using here: <Installdir>\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 OpenText Functional Testing for Developers to the embedded browser.
Manually update browser policies to allow OpenText UFT Agent extension installation
If the extension fails to install due to your browser policy or if you didn't select the Set Chrome, 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.
Edge
-
Add the OpenText UFT Agent Chrome Extension to the list of allowed extensions. For details, see https://docs.microsoft.com/en-us/deployedge/microsoft-edge-policies#extensioninstallallowlist.
The extension ID for this extension:
niefiagpjodjbabljbillefnehgbpnna
-
Add OpenText Functional Testing for Developers to the list of applications allowed to communicate with the extension. For details, see https://docs.microsoft.com/en-us/deployedge/microsoft-edge-policies#nativemessagingallowlist.
The application to add is:
com.hp.uft.nativemessaginghost
To enable this communication, you also need to enable the NativeMessagingUserLevelHosts option. For details, see https://docs.microsoft.com/en-us/deployedge/microsoft-edge-policies#nativemessaginguserlevelhosts.
Chrome
-
Add the OpenText UFT Agent Chrome Extension to the list of allowed extensions. For details, see https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallAllowlist.
The extension ID for this extension:
njkcecfgjklpakiaknffokgoafimlggp
-
Add OpenText Functional Testing for Developers to the list of applications allowed to communicate with the extension. For details, see https://cloud.google.com/docs/chrome-enterprise/policies/?policy=NativeMessagingAllowlist.
The application to add is:
com.hp.uft.nativemessaginghost
To enable this communication, you also need to enable the NativeMessagingUserLevelHosts option. For details, see https://cloud.google.com/docs/chrome-enterprise/policies/?policy=NativeMessagingUserLevelHosts.
Firefox
Add the OpenText UFT Agent Firefox Extension to the list of extensions to install. For details, see https://github.com/mozilla/policy-templates/blob/master/README.md#extensionsettings.
The path to add for this extension is:
Windows | <Installdir>\Installations\Firefox\WebExtension.xpi |
Linux / Mac | <Installdir>/Installations/Firefox/WebExtension.xpi |
See also: