Sending special keys and key event in selenium webdriver
Use the Below Code:
//Sending F5 key
driver.findElement(By.id("name")).sendKeys(Keys.F5);
//Sending arrow down key
driver.findElement(By.id("name")).sendKeys(Keys.ARROW_DOWN);
//sending Escape key
driver.findElement(By.id("name")).sendKeys(Keys.ESCAPE);
//sending pagedown key from keyboard
driver.findElement(By.id("name")).sendKeys(Keys.PAGE_DOWN);
//sending space key
driver.findElement(By.id("name")).sendKeys(Keys.SPACE);
//sending tab key
driver.findElement(By.id("name")).sendKeys(Keys.TAB);
//sending alt key
driver.findElement(By.id("name")).sendKeys(Keys.ALT);
No comments:
Post a Comment