-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 ?

Mansi Mehta
  • 19
  • 3
  • 8
  • make sure your library import is correct, `import org.openqa.selenium.chrome.ChromeDriver; ` Show us your code if thats not the case – theGuy Sep 20 '18 at 02:45

2 Answers2

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"

Ajinkya
  • 79
  • 1
  • 6
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")
iamsankalp89
  • 4,607
  • 2
  • 15
  • 36