CEF applications

Ranorex Studio supports testing of applications based on the following CEF technologies:

  • Chromium Embedded Framework (CEF)
  • CefSharp
  • Electron
  • NW.Js
  • Qt WebEngine
  • JxBrowser

To enable CEF testing, you need to enable the remote debugging port in the AUT. This page explains how to do so.

Enable the remote debugging port

To test CEF applications with Ranorex Studio, you have to enable the remote debugging port in the AUT.

For most CEF technologies, adding the following command line argument (e.g. to the Run application action in a recording module) when starting the AUT is sufficient:

MyApplicationUnderTest.exe –remote-debugging-port=8081

tipp icon

Attention

The port must not be used by another application or service on the machine where you’re running the test.

However, some technologies require a different approach.

CefSharp

If your AUT is based on CefSharp, the command line argument does not work. Instead, enable the remote debugging port in the source code of the AUT.

To set the remote debugging port in CefSharp, you have to specify it with help of the CefSettings class before initializing the control as follows:

 

var settings = new CefSettings();
settings.RemoteDebuggingPort = 8081;
Cef.Initialize(settings);

JxBrowser

If your AUT is based on JxBrowser, the command line argument does not work. Instead, enable the remote debugging port in the source code of the AUT by calling the BrowserPreferences.setChromiumSwitches(String…) method.

Please refer to this article in the official JxBrowser documentation to see how.

Troubleshooting

When testing CEF applications, you may come across a technology limitation warning. Here are potential causes and solutions for these technology warnings.

Another application is already listening on the remote debugging port

UI elements in your AUT can’t be identified because another application is blocking the remote debugging port (e.g. Chrome DevTools). Close the blocking program and restart the AUT.

Solution:

Ranorex Studio normally tries to close the blocking application automatically. In some cases, like for the Chrome Developer Tools, this doesn’t work. In this case, simply close all applications that may be connected to the AUT at the remote debugging port you specified.

If this fails, you can also try to change the remote debugging port number for the AUT.

Remote debugging not available

UI elements in your CEF AUT can’t be identified because the remote debugging port isn’t enabled in your AUT or can’t be found.

Solution:

Make sure you’ve activated the remote debugging port correctly (i.e. in source code if required) and that no other applications are using it. If you’ve set the remote debugging port number to something else than 8081, try resetting it to this value.