I'm using Selenium RemoteWebDriver to run tests written in Java on a remote MacBook. I maximize the browser window using:
driver.manage().window().maximize();
This works 100% of the time for Chrome, Firefox and IE11. But with Safari this seems to fail about 30% of the time. I thought maybe there could be some extra synchronization issues with Safari so I tried:
Thred.sleep(10*1000);
driver.manage().window().maximize();
Thred.sleep(10*1000);
Unfortunately this did not help. I'm getting the error message:
TimeoutException: Timed out awaiting response to command "maximizeWindow"
Does anyone know how to solve this?
Edit: Since it might matter, here's the URL and Capabilities I'm using to create the driver:
DesiredCapabilities caps = DesiredCapabilities.safari();
LoggingPreferences logPrefs;
logPrefs = new LoggingPreferences();
logPrefs.enable(LogType.BROWSER, Level.ALL);
caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
RemoteWebDriver driver= new RemoteWebDriver(new URL("http://serverIP/wd/hub"), caps)