Venkata
Venkata

Reputation: 1

Actions class in selenium 3.3.1 deprecated looking for solution with contextClick

I created my automation code on Selenium 2.44.0

Following code used to work fine

import org.openqa.selenium.interactions.Actions;

Actions action = new Actions(driver).contextClick(element); 
action.build().perform();

But now i am getting errors when i try to upgrade to Selenium 3.3.1 version.

Getting following error near important statement:

The import org.openqa.selenium.interactions.Actions cannot be resolved

Getting following error near contextClick:

Multiple markers at this line

  • Actions cannot be resolved to a type

  • Actions cannot be resolved to a type

When i look up for documentation found out that Actions class is deprecated, not sure how we can perform right click to get the context menu.

Upvotes: 0

Views: 1865

Answers (2)

Sasidhar Reddy
Sasidhar Reddy

Reputation: 11

No need to create new project. just remove the old libs and add updated libs only. if you are using pom file (if it is the Maven Project) then right click on project name then click update maven project. then click "Project" on file menu and then clean your project. It should work then.

Upvotes: 0

Apurv Chatterjee
Apurv Chatterjee

Reputation: 175

Just tried with selenium-server-standalone-3.3.1.jar and it works absolutely fine.

Actions Class still exists in Selenium 3.3.1, as there is no mention of its deprecation in Selenium 3.3.1 Change Log.

Could you please redownload the latest selenium bindings from SeleniumHQ, and rerun your script.

Upvotes: 1

Related Questions