Free Source Code and Tutorials

Custom Search

Perform right click using WebDriver

In this post, we will discuss how to perform right click if we are using Selenium WebDriver for automation testing.
For this purpose, we need to use Action class . Under Action class various method are defined for serving various actions that are needed to be performed while testing. For right click operation, we have contextClick() method available under Actions class. Below is the sample code :

  1. Actions action = new Actions(driver);
  2. //Actions class take WebDriver type object as argument
  4.  action .moveToElement(webElement).perform();
  6.  action .contextClick().perform();
Facebook Comments
(Visited 1 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: