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));

1 comment:

  1. Buy construction material online has been a game-changer for me! The convenience of browsing a wide range of products, comparing prices, and having everything delivered directly to the site is unbeatable. buy construction material

    ReplyDelete