Styrow.dev
Question 45 of 82

How can we press ENTER key on Textbox in selenium?

Question

How can we press ENTER key on Textbox in selenium?

Answer

We can use sendKeys() method with Enum Keys as below:

driver.findElement(By.xpath(""xpath"")).sendKeys(Keys.ENTER);


šŸ“² Practice Offline on Mobile: Download the free QA Automation & SDET Prep app on Google Play & App Store.