• +91 9723535972
  • info@interviewmaterial.com

Selenium Interview Questions and Answers

Question - With the help of code snippets, explain how we can create right-click and mouse hover actions in Selenium.

Answer -

The following code can replicate right-click action:

actions action = newActions(driver);
WebElement element = driver.findElement(By.id("elementId")); 
action.contextClick(element).perform();
The following code can replicate mouse hover action:

actions action = newActions(driver);
WebElement element = driver.findElement(By.id("elementId"));
action.moveToElement(element).perform();

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners