Ranorex Studio supports test automation for applications built on the Chromium Embedded Framework, or CEF, and related technologies, including:
- CefSharp
- Electron
- NW.js
- Qt WebEngine
- JxBrowser
To test CEF-based applications, enable the remote debugging port in the Application Under Test, or AUT. This allows Ranorex Studio to access and identify elements inside the embedded browser.
Enable the remote debugging port
For most CEF technologies, adding the following command line argument (for example, to the Run application action in a recording module) when starting the AUT is sufficient:
MyApplicationUnderTest.exe --remote-debugging-port=9222 --remote-allow-origins=*
Some technologies require a different setup. Review the following sections for technology-specific configuration details.
CefSharp
If your AUT is based on CefSharp, you must specify the port in the source code using the CefSettings class before initializing the control:
var settings = new CefSettings();
settings.RemoteDebuggingPort = 9222;
Cef.Initialize(settings);
JxBrowser
For JxBrowser applications, enable the remote debugging port in the source code by adding Chromium switches through the JxBrowser API. Depending on your JxBrowser version, this may be done by calling BrowserPreferences.setChromiumSwitches(String…) or by adding Chromium switches through the engine or browser configuration.
Use the following Chromium switches:
--remote-debugging-port=9222
--remote-allow-origins=*
Troubleshoot Element Detection in JxBrowser
If Ranorex Spy does not detect or access elements inside the JxBrowser view, verify the value configured for --remote-allow-origins.
For example, if your application uses a restricted origin such as:
.addSwitch("--remote-allow-origins=http://localhost:9222")
replace it with:
.addSwitch("--remote-allow-origins=*")
After updating the switch, restart the AUT and open Ranorex Spy again. Ranorex should now detect and interact with elements inside the embedded JxBrowser view.