Ajanth
Ajanth

Reputation: 2505

Java - Selenium 2 : Chromedriver - Exception calling driver.manage().window().setPosition()

I'm trying to run selenium tests with chromedriver. To hide chrome window on startup , I'm using the following code. Reference https://sqa.stackexchange.com/a/15489.

driver.manage().window().setPosition(new Point(-2000, 0)); 

The code above works fine in my local windows 7 OS and another Remote Machine running windows 8, but fails with the following exception in one Remote machine running windows 10.

[66.916][SEVERE]: Timed out receiving message from renderer: -11.117
    Exception in Main org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension 
     from timeout

For this exception, every answer I've found online only involves updating the chromedriver and chrome to the latest version, which I've done already.

I'm using the same versions across all OS : chrome driver : 2.29.461591 chrome version : 58.0.3029.110 Selenium version : 2.33.0

OS Info where it fails : Windows 10 Home 64 bit

Any help would be much appreciated, thanks.

Upvotes: 1

Views: 421

Answers (2)

san1deep2set3hi
san1deep2set3hi

Reputation: 5124

Try changing your machine resolution so that the moved chrome window does not completely disappeared in remote machine.

Upvotes: 0

iamkenos
iamkenos

Reputation: 1566

Just a hunch - Since your OS is 64 bit, chances are your Chrome browser is also 64-bit. It could be possible that you also have a 32-bit chrome installed and webdriver is launching the 32-bit that is maybe not updated? (again just a hunch).

First check if you have 32-bit or 64 bit. You should be able to tell the difference by clicking Chrome Help > About Google Chrome.

Unlike the one shown below, 32-bit will not have the "(64-bit)" text beside the version number. 64-Bit Chrome

Source: howtogeek.com

Now compare the version with the one getting launched by webdriver before you get the error.

If it's different, try setting the binary by doing something like:

ChromeOptions options = new ChromeOptions();
options.setBinary("path/to/latest/64-bit/chrome/Chrome.exe");

System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, "path/to/chrome/driver/chromedriver");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

WebDriver driver = new ChromeDriver(capabilities);

Just a hunch but i hope it helps.

PS. I tried the same thing with my machine, Win7 64 bit and it's working.

Upvotes: 1

Related Questions