3

We are using selenium 2.5.2 for our Java tests. And we decided that it is time to move forward to the latest selenium version (currently 3.14).

After downloading selenium 3.14 from https://www.seleniumhq.org/ and adding it to our project, some of the tests are having compilation problem

Actions cannot be resolved to a type.

I went to the import section of the class and I saw that the line import org.openqa.selenium.interactions.Actions is also having a compilation problem

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

I went to the loaded jar and I can see the class there.

So I took one more step and tried to decompile the class using DJ Java decompiler. When i tried to do this I got next error

Action violation at address...

I tried to decompile more classes from the jar and they all succeded. So I went to previous versions and figured out that in selenium version 3.2 they added internal class to Actions class BuiltAction.

Finally I went to version 3.1 and I was able to decompile the Actions class. I need help to solve this issue.

2
  • I'm getting the same problem. Did you get any resolution? Commented Sep 6, 2018 at 18:05
  • Partly, i was able to open new project and use it there. So i think it is some dependencies problem in my project. Commented Sep 6, 2018 at 18:07

1 Answer 1

2

Ok so there was an answer before, but because two people asked the same/similar question, I just posted the same thing twice.

Anyhow, the duplicate answer was deleted by the mod, but I would have at least expected them to link you the other question after deleting the answer here. Alas, people are not perfect.

However since the other question was badly worded anyway, I have since deleted the answer off of the other post, and I have added in the answer here again.


Interactions Actions was moved from selenium-remote-driver to selenium-api.

I had the same issue and then noticed while I was using v3.14.0 for everything else, my selenium-api was on v3.12.0.

It worked after I explicitly set the version in my POM:

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-api</artifactId>
  <version>3.14.0</version>
</dependency>

Hope it works for you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.