My current setup involves using Java and Selenium WebDriver for web automation. One issue I've encountered is that for Safari browser version 10.1, I need the browser to be in full screen mode before the test starts.
driver.manage().window().maximize();
However, this method does not seem to work as expected.
I have attempted several solutions without success:
1. It appears there is no direct option available to write something like a plist file in the /Library/Preferences folder of Mac:
defaults write com.apple.Safari
2. Another approach I tried involved sending keys using Selenium WebDriver:
WebElement element = Wait.wait.until(visibilityOfElementLocated(By.cssSelector(".logo-large")));
element.sendKeys(Keys.CONTROL , Keys.COMMAND , "f");
element.sendKeys(Keys.CONTROL , Keys.COMMAND , "F");
Actions action = new Actions(driver);
action.keyDown(Keys.CONTROL).keyDown(Keys.COMMAND).sendKeys("F").perform();
action.keyDown(Keys.CONTROL).keyDown(Keys.COMMAND).sendKeys("f").perform();
Is there a way to achieve fullscreen mode using send keys, editing the plist file, or through JavaScript?