28 November, 2014

How to perform Right-click/Context-click in Selenium Webdriver.

Using 'Action class' we can easily perform Right-click/Context-click on any Web-element.

Step 1: Store the Path of Web-element to be Right-clicked  in to the Web-element.
             Lets say  We have a Web-element name Test_element which we are right-clicking.
Step2:  We will use Action class to perform the Right-click/Context-click on our Web-element.
                              
 Actions actions = new Actions(driver);    
                 Action action=actions.contextClick(Test_element).build();     
                 action.perform();   

No comments:

Post a Comment