-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.15.0
-
None
-
Chromedriver v80 with WebEngine 5.15 on Windows
-
03d399308 (118-based), 1ad96f19f (118-based), dbfa94722 (dev), 3ed1eecbe (134-based-refactor)
We're using Selenium for automation with QtWebEngine 5.15. Ran into an issue where our application starts normally, but the Chromedriver crashes with an "Unrecognized Chrome Version" error.
I've attached a simple QT App and Selenium java program to repro the issue. I've also attached the java file to show the Selenium code used.
To repro:
- Unzip and build the SimpleQtHtmlPage application, then run it
- Unzip the Java jar, put it in the same folder as the chromdriver.exe and run
java -jar <path to jar>
Expected: Chromedriver can connect successfully to the WebEngine
Actual: Chromedriver is not able to connect, with the following error:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot connect to chrome at localhost:9222
from unknown error: unrecognized Chrome version: SimpleQtHtmlPage/
The workaround we've found is to set the QApplication ApplicationName to "Chrome" and ApplicationVersion to "80.0.3987.163". This is a regression as it was not necessary in previous versions of using these softwares together, we have successfully used Selenium for automation with QT 5.10
ContentBrowserClient::GetProduct was added for compatibility with Chromium 73, in this change]
Chromium sets the browser version by calling GetProduct, which returns ApplicationName/ApplicationVersion. The chromium code is here
In our actual application, we cannot change our ApplicationName and ApplicationVersion, so we've added code to ContentBrowserClient::GetProduct to return "Chrome/CHROMIUM_VERSION" if an environment variable is set, which means that it's being run using automation.
Is there a way to set the Browser name/version, without changing QApplication::ApplicationName and QApplication::ApplicationVersion?
- is required for
-
QTBUG-82046 Add chromedriver support to Qt Webengine
-
- Closed
-