MainMenu

Home Java Overview Maven Tutorials

Sunday 1 May 2022

How to Press Multiple Keys in Selenium


How to press mulitple keys in selenium

Example :- Press control + t key :



driver.findElement(By.cssSelector(“body”)).sendKeys(Keys.CONTROL + 't');

OR

driver.findElement(By.xpath("")).sendKeys(Keys.chord(Keys.CONTROL, "T"));

------------------------------------
How to press Enter keys in selenium
WebElement textbox = driver.findElement(By.id("idOfElement"));

textbox.sendKeys(Keys.ENTER);

How to Press thress keys simultaneously in selenium


driver.findElement(By.xpath("")).sendKeys(Keys.chord(Keys.CONTROL, Keys.ALT, Keys.DELETE));

No comments:

Post a Comment