enter keys in xpath element code example
Example 1: press enter selenium
driver.findElement(By.id("element_id")).sendKeys(Keys.ENTER);
Example 2: selenium press enter without element
try {
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
robot.delay(200);
}