You can send the Enter key to an element. However, you cannot press Enter to, say, confirm the download dialog.
WebElement elem = driver.findElement(By.id("damnit")); // obtain an element elem.sendKeys(org.openqa.selenium.Keys.ENTER); // this sends an Enter key to the element elem.sendKeys("hey" + org.openqa.selenium.Keys.ENTER); // this writes and then confirms by Enter
source share