Tuesday, February 16, 2016

Actions Class - how to simulate keyboard actions

In Webdriver, handling keyboard events and mouse events (including actions such as Drag and Drop or clicking multiple elements With Control key etc...) are done using the advanced user interactions API . It contains Actions and Action classes which are needed when performing these events.
In order to perform action events, we need to use org.openqa.selenium.interactions.Actions class.
sample :
// Configure the Action Actions myaction = new Actions(driver); // To click on the element myaction.moveToElement(element).click().perform();
Go to Site : www.flipcart.com and search for iPhone and press down arrow two times and then hit enter.