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 andChrome Browser
binary versions. Solution : Follow theChromeDriver Release Notes
- Using
driver.manage().window().maximize();
to maximize theChrome Browser
. Solution : UseChromeOptions.addArguments("start-maximized");
to maximize theChrome 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 theOS
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.