All application which is available on the web like all E-commerce like Flipkart, Amazon, Snapdeal they have all advanced activities for example mouse hover, drag and drop and right click etc. In these cases, we will use Actions class in Selenium.
For all advance activity in Selenium Webdriver, we can perform easily using Actions class like Drag and Drop, mouse hover, right click, Click and Hold and so on.
We have predefined method called dragAndDrop(source, destination) which is a method of Actions class.
Approach- Find the xpath of the Source and find the xpath of destination.
Both source and destination in form of WebElement.
Any method of Actions class we need to call perform() method otherwise we will get an exception. If we have series of action in our script using Actions class then we have to call build().perform() method.
For all advance activity in Selenium Webdriver, we can perform easily using Actions class like Drag and Drop, mouse hover, right click, Click and Hold and so on.
We have predefined method called dragAndDrop(source, destination) which is a method of Actions class.
Approach- Find the xpath of the Source and find the xpath of destination.
Any method of Actions class we need to call perform() method otherwise we will get an exception. If we have series of action in our script using Actions class then we have to call build().perform() method.