how to click enter in selenium code example

Example 1: enter key in selenium

To press ENTER key using Selenium WebDriver, We need to use Selenium 
Enum Keys with its constant ENTER.

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

Example 2: press enter selenium

driver.findElement(By.id("element_id")).sendKeys(Keys.ENTER);

Example 3: how to press enter in selenium

To press ENTER key using Selenium WebDriver, We need to use Selenium
Enum Keys with its constant ENTER.

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

Tags:

C Example