'Selenium how to press two different key combinations after starting up the browser
So im trying to load a website with node selenium, and when im at its root, just press two different key combinations, waiting a bit between each other.
So far ive gotten this
const webdriver = require('selenium-webdriver');
const Keys = webdriver.Key
const By = webdriver.By
const driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.firefox()).
build();
driver.get('https://example.com');
//this element is supposed to be some almost root container, but ideally i dont want to select anything, just press the keys.
driver.findElement(By.id('canvas-container')).sendKeys('webdriver', Keys.CTRL + Keys.F5);
driver.findElement(By.id('canvas-container')).sendKeys('webdriver', Keys.CTRL + Keys.F5);
//wait 2-5 sec
driver.findElement(By.id('canvas-container')).sendKeys('webdriver', Keys.CTRL + Keys.SHIFT + Keys.C);
That doesn't work because
Element is not reachable by keyboard
Can someone help with this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
