Create a series of actions, and then complete them. A useful demonstration of how to release a control key is to remove the add-in panel by simulating pressing Control + / , and then sending a keyUp message to release the held Control key:
WebDriver driver = getDriver(); String handle = driver.getWindowHandle(); // Remove the "add-on" bar. driver.switchTo().defaultContent(); Actions actions = new Actions( driver ); actions .sendKeys( Keys.CONTROL, Keys.DIVIDE ) .keyUp( Keys.CONTROL ) .build() .perform(); // Return back to whatever window was first selected. driver.switchTo().window( handle );
source share