press enter selenium
snippet in c

enter key in selenium

user4478

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

press enter selenium

user1361

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

selenium press enter without element

user7543

try {
    Robot robot = new Robot();
    robot.keyPress(KeyEvent.VK_ENTER);
    robot.keyRelease(KeyEvent.VK_ENTER);
    robot.delay(200);
}