I've installed latest Google Chrome 57.0.2987.110, on my Ubuntu server (16.04).
I'm using canopy (which is F# wrapper for Selenium).
I put latest chromedriver in the same folder as my binary, version: 2.28.455506 (and I set the correct path to driver).
I'm starting chrome with --headless argument, like this:
let chromeOpts = ChromeOptions ()
chromeOpts.AddArgument "--headless"
chromeOpts.AddArgument "--disable-gpu"
chromeOpts.AddArgument "start-maximized"
start <| ChromeWithOptions chromeOpts
As soon as it's starts I get this error:
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 4.4.0-64-generic x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError (OpenQA.Selenium.Remote.Response errorResponse) [0x000d5] in <2096f357ed27440a8e98c8a8dd645cdd>:0
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute (System.String driverCommandToExecute, System.Collections.Generic.Dictionary`2[TKey,TValue] parameters) [0x00046] in <2096f357ed27440a8e98c8a8dd645cdd>:0
at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute (System.String driverCommandToExecute, System.Collections.Generic.Dictionary 2[TKey,TValue] parameters) [0x00000] in <2096f357ed27440a8e98c8a8dd645cdd>:0
at OpenQA.Selenium.Remote.RemoteWindow.set_Size (System.Drawing.Size value) [0x00067] in <2096f357ed27440a8e98c8a8dd645cdd>:0
at canopy.core.pin (canopy.types+direction direction) [0x0002f] in <58c4b5b9d8107025a7450383b9b5c458>:0
at canopy.core.start (canopy.types+BrowserStartMode b) [0x0050c] in <58c4b5b9d8107025a7450383b9b5c458>:0
It's seems that it fails to set window size.
Is it proper way to launch headless Chrome? I read somewhere that newest version has headless feature.
As I'm using newest version of both Google Chrome and chromedriver I think it shouldn't be a version mismatch.
Also it's working fine on ma local Windows 10 machine with same version of chromedrive (just for windows).
Running with command (and without headless argument):
DISPLAY=:1 xvfb-run mono myapp.exe
Seems to work. I think this resolves my issue.
I leave it here for others looking for a way tu run headless chrome and having same problem.
This solution comes from: http://coderscoffeehouse.com/tech/2017/01/17/headless-front-end-testing-on-linux-using-fsharp.html
There's an open Chromium issue on this topic. It states:
Headless mode doesn't currently support extensions, and it's not clear
whether we can support them easily -- although we are doing some
initial feasibility analysis.
As suggested by #mateuszlewko, the X Virtual Framebuffer (XVFB) can be used as a Linux workaround.
Related
First the Environment:
Node JS 16.15.0
Web Driver io v7 (wdio)
wdio/cucumber framework
end to end testing of a website
-obviously using cucumber and feature files
using a test configuration file similar to wdio's
using wdio-chromedriver-service v7.2.6 and npm chromedriver package version ^107 to produce a browser to hit
my browser : chrome v107.0.5304.62
The Question:
an element cannot be found by webDriver as I expect, but the command causes the instance to crash
I am searching for an element that no longer appears on the page (it is a spinner element that shows the page is loading)
I call
if(await this.spinner.isDisplayed())
and then the test run hangs, the debugger tells me the command
INFO webdriver: COMMAND findElement("css selector", "i.fa-spinner")
is running and then nothing else, finally the renderer times out
WARN chromedriver: [SEVERE]: Timed out receiving message from renderer: 600.000
DEBUG webdriver: request failed due to response error: timeout
and the chrome instance crashes shortly later
I am unsure why this behavior is happening, is something wrong with my wdio configuration? or with my chrome driver?
What I have tried
I understand that
browser.setTimeout exists but
I am sure it is not set in my config anywhere.
I have done a global search (using vscode for all development) for browser.setTimeout (no results).
I have manually set browser.setTimeout({ 'implicit': 0 }) (no success).
I have also tried directly hitting a chrome driver instance by manually downloading a chrome driver exe that matched my browser version v107.0.5304.62 and removing the 'services: ['chromedriver']'
from my test config file
when this happens something very interesting occurs, I can keep running after searching for the element that broke the run before, but we dont get very far and the command still causes issues. Chrome driver is throwing errors like
error: 'no such element',
[0-0] message: 'no such element: Unable to locate element: {"method":"css selector","selector":"i.fa-spinner"}\n' +
[0-0] ' (Session info: chrome=107.0.5304.87)'
The browser closes shortly afterwards without progressing through the rest of the tests.
I find it interesting that the version that chrome driver says it is running is 107.0.5304.87 since the version of chromedriver I downloaded clearly says it is v107.0.5304.62 and my chrome version clearly states it is also v107.0.5304.62 .
though theoretically using v107.0.5304.87 shouldnt be an issue according to this
since the 107.0.5304 part matches across the board
I could use some assistance.
We had the same issue this days, seems there is a bug introduced in Chrome 106; try to change config or downgrade Chrome on the machine to use Chrome 105 as with this version is working.
I have been trying to setup automation testing for our openfin application using the below repo as base
https://github.com/openfin/webinar-automated-integration-tests
I am using Openfin (Chrome version 61.0.3163.100) and Chromedriver 2.40.565498
When I run "npm test", the openfin application opens up. But the tests don't run. After waiting for sometime, it throws the below error in console.
ERROR: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
chrome
I tried using other versions of chromedriver like 2.33, 2.34, 2.37, 2.38, 2.39, 2.41. Using these versions even the application doesn't appear. So, I guess the chromedriver version I am using is correct. I have also tried adding the below arguments to chromeOptions
--remote-debugging-port=9222,--no-sandbox,--headless,--disable-gpu
They didn't solve my issue. Not sure what is causing the issue. Any help would be much appreciated. Thanks in advance. Cheers!
This error message...
ERROR: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.40
Release Notes of chromedriver=2.40 clearly mentions the following :
Supports Chrome v66-68
Presumably you are using chrome=61.0
Release Notes of ChromeDriver v2.33 clearly mentions the following :
Supports Chrome 60-62
Your Selenium Client version is unknown to us.
So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v60.0
Solution
Ensure that:
Selenium is upgraded to current levels Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v80.0 level.
Chrome is updated to current Chrome Version 80.0 level. (as per ChromeDriver v80.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
When trying to call Sendkeys method in selenium webdriver it is displaying below error:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64) (WARNING: The server did not provide any stacktrace information)
Selenium Jarversion: 3.10.0
The error says it all :
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.1.7600 x86_64)
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.27
Release Notes of chromedriver=2.27 clearly mentions the following :
Supports Chrome v54-56
You are using chrome=65.0
Release Notes of ChromeDriver v2.36 clearly mentions the following :
Supports Chrome v65-66
Your Selenium Client version is 3.10.0.
Your JDK version is unknown to us.
So there is a clear mismatch between the ChromeDriver version (v2.27) and the Chrome Browser version (v65.0)
Solution
Upgrade ChromeDriver to ChromeDriver v2.36 level.
Keep Chrome version at Chrome v65.x levels. (as per ChromeDriver v2.36 release notes)
Clean your Project Workspace and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Chrome version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Chrome.
Execute your #Test.
An older version of the ChromeDriver is being spun off when the test is being run; to remedy:
Ensure that you've gotten your browser up to date (v65-67) and get the latest version of the ChromeDriver executable(v2.38)
Extract the ChromeDriver and explicitly set the System property when initializing the ChromeDriver object...
Ex:
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver.exe");
WebDriver driver = new ChromeDriver();
I had encountered the same issue. The issue got resolved by updating the chromedriverexe. please check the compatibility of your chrome browser with chrome driver here To download chromedriver
I am stuck with a very unusual kind of error thrown by Chrome Browser
When I try to do maximize chrome with below line of code
driver.manage().window().maximize();
I am getting below error
org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=57.0.2987.110)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.05 seconds
By going through this example I did the below things
1. Updated Chrome driver to latest i.e 2.28 for my Chrome version
57.0.2987.110 (64-bit)
2. uninstalled and re-installed Chrome
3. did a project build up in Eclipse even created a new workspace
but nothing helped so I used
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
driver = new ChromeDriver();
it worked and Chrome driver showed no error but whenever I execute some piece of code like filling a form or clicking some button after that it still throws the above error after some time.
In general the reason you see WebDriverException: unknown error: cannot get automation extension can be numerous. The two most common cases to see this exception is :
Mismatch between chromedriver binary and Chrome Browser binary versions. Solution : Follow the ChromeDriver Release Notes
Using driver.manage().window().maximize(); to maximize the Chrome Browser. Solution : Use ChromeOptions.addArguments("start-maximized"); to maximize the Chrome Browser.
As per your question the exception seems to be coming from one of the above cases.
Try out the following steps:
Kill all the chromedriver instances running in your windows Task Manager.
Use CCleaner tool to wipe out all the OS chores.
Clean all the projects in Eclipse.
Reboot your system once.
Provide the following options to start your Chrome browser:
ChromeOptions options = new ChromeOptions();
options.addArguments("test-type");
options.addArguments("start-maximized");
options.addArguments("disable-infobars");
options.addArguments("--disable-extensions");
driver = new ChromeDriver(options);
Your program should work with latest chrome driver 2.28 & Chrome Version 57.0.2987.110 (64-bit). Let me know if this helps you.
I had the same issue before, remember fixing it by adding this:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("no-sandbox");
//Fix for cannot get automation extension
chromeOptions.addArguments("disable-extensions");
chromeOptions.addArguments("--start-maximized");
Currently I'm using the follow stack:
1. Selenium Webdriver 3.0.1 (NodeJS API)
2. Mocha
3. Chromedriver 2.25.3
Often when I run my tests in Codeship (continuous integration) I get this error:
Uncaught WebDriverError: chrome not reachable
(Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 4.2.0-42-generic x86_64)
Note: This never happened running locally, only occurs when my tests start in codeship, and it's an intermittent error (sometimes it happens, sometimes not)
Screenshot error:
Any ideia how solve this?
Does codeship have chrome installed on their test server?
I'm guessing not. It might be better to run this against phantomjs (headless browser) instead for CI purposes.