L21.1: Actions class Example #1

PHOTO EMBED

Thu Oct 19 2023 02:09:38 GMT+0000 (Coordinated Universal Time)

Saved by @testpro #java

Actions action = new Actions(driver);

//Move over the menu options
WebElement menuOption = driver.findElement(By.xpath("locator"));
action.moveToElement(menuOption).perform();

//Displays the menu list with options, now we can click an option from the menu list
WebElement selectMenuOption = driver.findElement(By.xpath("locator2"));
action.click(selectMenuOption).perform();
content_copyCOPY