Home > Programming, QA, Test and Automation Stuffs > Context click with actions (WebDriver)

Context click with actions (WebDriver)

Hello !!

 

Do you need simulate a context click (right-click) in some element ?

With the lib actions is simple. First you need import the actions of java and after

 

Actions actions = new Actions(driver);     //Instance the Actions

WebElement Element = driver.findElement(By.id(“ID“)); // find the element and put is in a variable

actions.ContextClick(Element).Perform(); // position the mouse over the element and context click it.

 

Just this, in some cases you have put a speed more lower or a wait element os something like that to work well.

 

Bye bye !!

 

Advertisements
  1. No comments yet.
  1. July 2, 2014 at 11:11 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: