3

I can't do the following two imports in Selenium 3.4.0

import org.openqa.selenium.remote.CapabilityType;  
import org.openqa.selenium.remote.DesiredCapabilities;

My maven dependencies for selenium is as below:

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

I'm getting error messageslike The import org.openqa.selenium.remote.CapabilityType cannot be resolved in Eclipse

What could be the problem?

2
  • try right mouse on project -> maven -> update project -> update depedencies Commented Aug 9, 2017 at 18:31
  • @ByeBye i have done it many times, still doesn't work. Commented Aug 10, 2017 at 13:37

2 Answers 2

1

As you are trying to include the following imports:

import org.openqa.selenium.remote.CapabilityType;  
import org.openqa.selenium.remote.DesiredCapabilities;

You have already added the org.seleniumhq.selenium and org.seleniumhq.selenium dependencies in the pom.xml.

Now, as per the Selenium 3.4.0 Documentation here as you want to use the RemoteWebDriver implementation, you still need to download the selenium-server-standalone.jar from the Selenium Download page and and then either put it into your resources folder and manipulate it through Runtime or put it somewhere else and manipulate it via command line.

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

3 Comments

I embed the selenium server. The issue is only there for selenium 3.4.0. It works perfectly fine in selenium 3.0.1 (with chrome). I am trying to use geckodriver with the latest selenium version.
@chenzen So where are you exactly stuck now? Did you download the selenium-server-standalone.jar? Can you share your research?
i solved it by adding the selenium java client to the build path directly.
1

Add this additional dependency in your pom.xml

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-remote-driver -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-remote-driver</artifactId>
    <version>2.44.0</version>
</dependency>

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.