Aug 22, 2019 in Selenium
Q: How to mouse hover on a web element using WebDriver?

1 Answer

0 votes
Aug 22, 2019
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.

Related questions

0 votes
Aug 22, 2019 in Selenium
0 votes
Aug 22, 2019 in Selenium
...