课程: Test Automation with Selenium WebDriver for Java

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Solution: Multiple key press

Solution: Multiple key press

(upbeat) - [Instructor] To execute the Control + Shift + 1 combo, we use the Actions class to hold down the Control and Shift keys by calling keyDown for both, then calling sendKeys to press the number 1. This chain of command successfully triggers the background change, but we need to release the buttons that we're holding. To do so, we called the keyUp method for the Shift and Control keys, and then we call perform to execute the entire chain.

内容