Selenium can automate the browsing of websites and web pages.
This time, I will specify how to hover and then click the extracted DOM element.
By hovering the element, programmatically, the mouse cursor is over the DOM element
is expressed.
Java
import org.openqa.selenium.interactions.Actions;
public static void autoHoverClick(WebDriver driver, WebElement element){
Actions act = new Actions(driver);
act.moveToElement(element).perform(); //Hover the specified DOM element(hover)
element.click(); //Click on the DOM element
}
Recommended Posts