InterviewSolution
Saved Bookmarks
| 1. |
How to send ALT/SHIFT/CONTROL keys at once in Selenium WebDriver? |
|
Answer» Usually, we hold down these keys and click other buttons to achieve any unique functionality. To hold on to these keys, we need to define two more methods apart from keys.ALT or keys.SHIFT or keys.CONTROL functions. To include more than one key to be pressed or released, we can pass ALT, SHIFT, and CONTROL as parameters together in the modifier key argument. Here is the syntax for the same: Actions a = new Actions(driver)a.keyDown(Keys.ALT).keyDown(Keys.SHIFT) .keyDown(Keys.CONTROL).sendKeys('test') .build() .perform(); |
|