0

I am facing following issue when trying to capture Selenium Webdriver screenshot with Chrome (v60). I am running my tests using Selenium Grid and the screenshot mechanism works fine for Firefox.

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=60.0.3112.113)
  (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.34 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
JavaMan
  • 465
  • 1
  • 6
  • 21
  • possible duplicate of https://stackoverflow.com/questions/25890027/cannot-get-automation-extension-from-timeout-timed-out-receiving-message-from-r#26283818 – Ranjith's Sep 04 '17 at 14:02

2 Answers2

0

Use ChromeOptions class to achieve this.

Try this below code:

ChromeOptions coptions = new ChromeOptions();
coptions.addArguments("enable-automation");
coptions.addArguments("--disable-infobars");
WebDriver driver = new ChromeDriver(coptions);
iamsankalp89
  • 4,607
  • 2
  • 15
  • 36
  • thanks, I tried this option but it did not help however, upgrading to the latest version of chrome driver worked like a breeze. Thanks once again for taking time to respond to my question. – JavaMan Oct 02 '17 at 16:53
0

You need the latest version of chromedriver.exe. https://sites.google.com/a/chromium.org/chromedriver/downloads

This is needed for chromedriver version 57+

I was having this same issue. Once I updated the chromedriver version everything worked again.

halfer
  • 19,824
  • 17
  • 99
  • 186
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
  • Thanks Shubham, we have a massive nightly regression running across multiple environments, so was really scared to probe this option, I guess your answer reinforced the fact this is the correct option and planning upgrade properly really helped. Cheers !!! – JavaMan Sep 30 '17 at 22:42