Enable testing HTML controls when using a specific browser control option

Supported in UFT One versions 2023 and later

This topic describes how to enable UFT One 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 - patch 10

  • 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 Micro Focus.

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 Micro Focus 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:

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

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

  3. Decompress the WebDriver package and put the files in the %install%\\Micro Focus\UFT One\bin\WebDriver folder.

  4. Set the registry keys to enable remote debugging for your SAP GUI for Windows application.

    1. Open the Windows Registry Editor with administrative permissions.

    2. 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)

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

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

  5. Restart your SAP GUI for Windows application and launch UFT One.

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

  7. Connect to your SAP GUI for Windows application.

    1. Add the following statement to your test to enable UFT One 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 UFT One Object Model Reference for GUI Testing.

    2. Type netstat -na | find "port" at the command prompt again to check the port status.

      If the port status is ESTABLISHED, the connection between UFT One 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.

Back to top

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:

  1. Open SAP NWBC Client. Choose New > New System Connection, and add the system URL.

  2. 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%\\Micro Focus\UFT One\bin\WebDriver folder.

    Make sure the Microsoft Edge WebDriver version you download matches Microsoft Edge WebView2 installed on your machine.

  3. Close SAP NWBC Client. Then go to C:\ProgramData\SAP\NWBC.

  4. 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>
  5. 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.

  6. Register the required apps. See the prerequisites described in Windows-based SAP support.

  7. Open UFT One with required add-ins.

  8. Enable UFT One 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 UFT One Object Model Reference for GUI Testing.

    Now, you can spy and record on objects in the application.

Tip: If UFT One 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.

Back to top

See also: