WebDriver Sending Keys Combination - Codoid
Select Page
Selenium

WebDriver Sending Keys Combination

The below snippet shows how to press 'Ctrl+G' keys combination in an object.

You can send sequence of characters and keyboard keys in ‘SendKeys’ method. And it is possible to give more sequence of keys and strings with ‘,’ delimited.

The below snippet shows how to press ‘Ctrl+G’ keys combination in an object.

Code

WebElement txtGoogle=firefox.findElement(By.name("q"));
txtGoogle.sendKeys(Keys.CONTROL,"G");  

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


You can send sequence of characters and keyboard keys in ‘SendKeys’ method. And it is possible to give more sequence of keys and strings with ‘,’ delimited.

The below snippet shows how to press ‘Ctrl+G’ keys combination in an object.

Code

WebElement txtGoogle=firefox.findElement(By.name("q"));
txtGoogle.sendKeys(Keys.CONTROL,"G");