Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The import org.openqa.selenium.remote.CapabilityType cannot be resolved

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?

like image 263
chenzen Avatar asked Sep 24 '26 08:09

chenzen


1 Answers

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.

like image 182
undetected Selenium Avatar answered Sep 26 '26 22:09

undetected Selenium