Keyboard Actions in Selenium package SeleniumLearn; import org.testng.annotations.Test; import org.testng.annotations.BeforeTest; import java.awt.Robot; import java.awt.event.KeyEvent; import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; import org.testng.annotations.AfterTest; Read more about Keyboard Actions in Selenium