-1

I am trying to do some automation projects with chrome, java and selenium and having problems importing the chrome driver.

Error: import org.openqa.selenium.chrome.chromedriver cannot be resolved

Can anyone help me for this ?

1
  • make sure your library import is correct, import org.openqa.selenium.chrome.ChromeDriver; Show us your code if thats not the case
    – theGuy
    CommentedSep 20, 2018 at 2:45

2 Answers 2

0

Try cleaning your project by navigating to the following menu item:

Project > Clean... then click on Project > Build Automatically If that doesn't work, try removing the jars from the build path and adding them again.

please take a look at the code here - https://gist.github.com/ajinkya-mundankar/3768339eeb54755d937386138582dca0

you can refer from here - Eclipse error: "The import XXX cannot be resolved"

    0

    If You are using Selenium 3.x you have to mention the Key-Value pair using System.setProperty() line mandatory as follows :

    System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver"); 

    Sample code is like this

    public class SitePoster {

    System.setProperty("webdriver.chrome.driver", "./pathtodriver"); WebDriver driver = new ChromeDriver(); driver.get("//https://google.co.in") 

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.