I am currently experiencing an issue where the below code successfully opens a Chrome browser, but it fails to fullscreen the browser using F11. In the past, I used C# and Selenium which worked fine with this method on Chrome and other browsers. It locates the 'body' element but does not send the key press. Am I missing something here that requires another library?
The documentation for webdriverjs is lacking, with very few examples available. I am strongly considering switching to another language like Python.
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('https://www.google.co.uk/');
driver.wait(function () {
return driver.getTitle().then(function (title) {
return title === 'Google';
});
}, 1000);
driver.findElement(webdriver.By.xpath('/html/body')).sendKeys("F11");
We are developing a website that will adjust based on screen size, specifically 800x600 and with or without the toolbar. The content displayed will vary depending on how the screen is utilized. While I can maximize the window using,
driver.manage().window().maximize();
This only maximizes the window without hiding the toolbar as if the user had pressed the F11 key.