in Selenium by
Q:
How to mouse hover on a web element using WebDriver?

► Click here to show 1 Answer

0 votes
by
By using Actions class

WebElement ele = driver.findElement(By.xpath("xpath"));

//Create object 'action' of an Actions class

Actions action = new Actions(driver);

//Mouseover on an element

action.moveToElement(ele).perform();

1

2

3

4

5

WebElement ele = driver.findElement(By.xpath("xpath"));

//Create object 'action' of an Actions class

Actions action = new Actions(driver);

//Mouseover on an element

action.moveToElement(ele).perform();

Practical Example.
Selenium
Learn More with Madanswer

Related questions

0 votes
asked Aug 22, 2019 in Selenium by john ganales
...