Enable testing HTML controls when using a specific browser control option
This topic describes how to enable OpenText Functional Testing to test embedded HTML controls that are set to use Edge or Chromium in SAP GUI for Windows or SAP NWBC desktop applications.
Note: This functionality is supported only on the following applications:
-
SAP GUI for Windows 7.70 patch 6 and later
-
SAP GUI for Windows 8.00 patch 0 and later
-
SAP NWBC Client 7.0 patch 13 and later
-
SAP NWBC Client 7.7 patch 16 and later
-
SAP NWBC Client 8.0 patch 0 and later
Caution: The instructions in this topic include downloading a WebView2 driver from the Internet, which is not provided by OpenText.
We encourage you to use only genuine executable files from the official site. 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.
SAP GUI for Windows
Before you test HTML controls whose type is set to Edge (based on Chromium) in SAP GUI for Windows, do the following:
-
Open SAP GUI for Windows and set the browser control type to Edge (based on Chromium) for HTML controls.
Tip: We recommend that you close open browsers when working with Edge-based HTML controls inside an SAP GUI for Windows application. Otherwise, an error may occur.
-
Close SAP GUI for Windows. Download Microsoft Edge WebDriver from the official download page.
Make sure the Microsoft Edge WebDriver version you download matches Microsoft Edge WebView2 installed on your machine.
-
Decompress the WebDriver package and put the files in the %install%\OpenText\UFT One\bin\WebDriver folder.
-
Set the registry keys to enable remote debugging for your SAP GUI for Windows application.
-
Open the Windows Registry Editor with administrative permissions.
-
Depending on the bit versions of your SAP GUI for Windows application and operating system, navigate to the corresponding folder:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SAP\General (32-bit SAP GUI for Windows on a 64-bit Windows system)
HKEY_LOCAL_MACHINE\SOFTWARE\SAP\General (64-bit SAP GUI for Windows on a 32-bit or 64-bit Windows system)
-
Add the EdgeBrowserEnableRemoteDebugging (REG_DWORD) registry key and set it to 1.
This registry key enables remote debugging on Edge-based HTML controls in your SAP GUI for Windows application.
-
Add the EdgeBrowserRemoteDebuggingPort (REG_DWORD) registry key and set it to a valid debug port number.
This configures your SAP GUI for Windows application to always open a port for remote debugging.
Port 8081 is a decimal value. If you want to set the registry value to 8081, set Base to Decimal first.
Note: If you configured an environment variable to remotely debug a Microsoft Edge WebView2 application on your computer, this environment variable can override the EdgeBrowserRemoteDebuggingPort (REG_DWORD) registry value.
Make sure that you remove that environment variable before testing Edge-based HTML controls in SAP GUI for Windows applications.
-
-
Restart your SAP GUI for Windows application and launch OpenText Functional Testing.
-
Type
netstat -na | find "port"
at the command prompt to check whether the debug port you defined in Step 4 is opened.If the port status is LISTENING, the debug port is opened.
-
Connect to your SAP GUI for Windows application.
-
Add the following statement to your test to enable OpenText Functional Testing to attach to your application, and run the test.
WebUtil.AttachRemoteDebugging "localhost:<port>","MsEdgeWebView2"
For more information about this statement, see the WebUtil object in the Utility section of the Object Model Reference for GUI Testing.
-
Type
netstat -na | find "port"
at the command prompt again to check the port status.If the port status is ESTABLISHED, the connection between OpenText Functional Testing and your SAP GUI for Windows application is established.
Now you can spy, record, and run tests on Edge-based HTML controls in your SAP GUI for Windows application.
-
SAP NWBC Desktop
Before you test HTML controls whose type is set to Chromium or Edge in an SAP NWBC desktop application, do the following:
-
Open SAP NWBC Client. Choose New > New System Connection, and add the system URL.
-
In Settings > Accessibility > Browser, set Primary Browser Control to Chromium or Edge.
Note: To test Edge browser controls, you must download Microsoft Edge WebDriver and put the downloaded files in the %install%\\OpenText\UFT One\bin\WebDriver folder.
Make sure the Microsoft Edge WebDriver version you download matches Microsoft Edge WebView2 installed on your machine.
-
Close SAP NWBC Client. Then go to C:\ProgramData\SAP\NWBC.
-
Create a new file named NwbcOptions.xml in that directory and add the following content to the file:
Copy code<?xml version="1.0" encoding="utf-8"?>
<NwbcOptions>
<SingleOptions>
<EnableRdpAccess>true</EnableRdpAccess>
</SingleOptions>
</NwbcOptions> -
Launch the SAP NWBC Client executable directly with the following command line argument:
Filepath/NWBC.exe /remotedebuggingport=8081
A pop-up shows in the bottom right corner of the desktop, indicating that the remote debugging port is accessible.
-
Register the required apps. See the prerequisites described in Windows-based SAP support.
-
Open OpenText Functional Testing with required add-ins.
-
Enable OpenText Functional Testing to attach to your SAP NWBC Client. To do that, add the following statement to your test:
WebUtil.AttachRemoteDebugging "localhost:<port>","Mode"
For more information about this statement, see the WebUtil object in the Utility section of the Object Model Reference for GUI Testing.
Now, you can spy and record on objects in the application.
Tip: If OpenText Functional Testing fails to identify browser controls as SAP objects, we recommend that you use DetachRemoteDebugging to detach from the application and then re-attach using AttachRemoteDebugging.
See also: