1

I am using Selenium WebDriver 3.0.1 in a Maven based project. This code snippet fails (does not compile):

Actions myActions = new Actions(myWebDriver);

because the org.openqa.selenium.interactions.Actions class is missing from the selenium-api-3.0.1.jar downloaded from maven. This is the relevant portion of the pom.xml:

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-firefox-driver</artifactId>
    <version>3.0.1</version>
</dependency>
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-support</artifactId>
  <version>3.0.1</version>
  <type>jar</type>
</dependency>
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-api</artifactId>
  <version>3.0.1</version>
</dependency>
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-htmlunit-driver</artifactId>
  <version>2.52.0</version>
</dependency>
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-remote-driver</artifactId>
  <version>2.31.0</version>
</dependency>

I also tested this alternative dependency in pom.xml:

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-server</artifactId>
  <version>3.0.1</version>
</dependency>

but in both cases the org.openqa.selenium.interactions.Actions class is missing from the downloaded selenium-api artifact.

Searching the class in Maven repository with grepcode.com finds only version 2.47.1 or older.

I downloaded the Selenium Client & WebDriver Language Bindings zip package directly from the http://www.seleniumhq.org/download/ url and the included client-combined-3.0.1-nodeps.jar file does contain the org.openqa.selenium.interactions.Actions class.

It seems that I am missing something ... but I really have no idea how to fix the Maven dependency. Any help will be enthusiastically accepted!

Rodia
  • 1,407
  • 8
  • 22
  • 29
Luca Buraggi
  • 35
  • 1
  • 5

1 Answers1

1

Seems like the org.openqa.selenium.interactions package, including the Actions class, got moved to selenium-remote-driver.

You can either add a dependency to selenium-remote-driver directly, or, even simpler, add a dependency to to selenium-java (that depends on selenium-chrome-driver which in turn depends on selenium-remote-driver). I would try to go with the latter option as this should allow you to get rid of a lot of other explicit dependencies as well.

ralph.mayr
  • 1,320
  • 8
  • 12
  • You are right! - changing the dependencies to the single `selenium-java` dependency fixedthe problem. The first suggestion doesn't help: as shown in my first pom.xml extract, the `selenium-remote-driver` dependency was already present, but with version = 2.31.0 - strange enough, in the maven repository this is the most recent version available (but, even stranger, the `selenium-java` dependency now downloads also the version 3.0.1 of `selenium-remote-driver`, apparently from nowhere !) – Luca Buraggi Feb 18 '17 at 14:12
  • And of course, an enthusiastic thank you for the help ! – Luca Buraggi Feb 18 '17 at 14:13