Testing of CEF Applications
- Chromium Embedded Framework (CEF)
Preparing the application under test
To start testing CEF applications with Ranorex, you have to enable the remote debugging port in the application under test (AUT).
You can do so by using the command line argument 'remote-debugging-port' when starting the AUT. For example: MyApplicationUnderTest.exe --remote-debugging-port=8081
The port number you are using in this command must not be used by another application or service on the windows machine you are testing the AUT.
In a Ranorex recording you can add this command line argument to the 'Run Application' action.
If your AUT is based on CefSharp, the command line argument does not work. Please 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 like this:
var settings = new CefSettings();
settings.RemoteDebuggingPort = 8081;
With GPU acceleration active, the screenshots used by Ranorex Studio for image validation and in the report may be faulty. This is in part caused by the way CEF passes image data to the GPU.
To make sure screenshots display correctly, start your CEF application with the following parameter:
When testing CEF applications, you may come across a technology warning. Here are potential causes for these technology warnings:
Another application is already listening on the remote debugging port
If another application on the machine is already listening on the remote debugging port of the application under test, Ranorex cannot connect to the AUT.
By Default, Ranorex tries to close these applications. In some cases, like the Chrome Developer Tools, this is not successful. That is why a manual action from the user is needed.
Please try to:
- Close all other applications, like the Chrome Development Tools, that may have a connection to the application under test at the remote debugging port.
- Choose a different port number as remote debugging port for the application under test.
CEF UI element invisible
The UI element containing the CEF control is not visible. In order to test the web content inside the CEF control, the containing UI element has to be visible.Please try to
- Include an action in your recording to make sure the UI element is visible.
Remote debugging not available
The remote debugging interface of the application under test is not available. However, this is a prerequisite for testing CEF applications with Ranorex.
Please try to:
- Make sure the application under test is correctly prepared.
- The port number used as remote debugging port must not be used by any other application on the machine.
- Make sure no other application on the machine listens to the remote debugging port the application under test provides.