0

Below are the versions i used.

Java 11.0 Selenium webdriver 3.14

Can anyone please let me know the solution for this.

package packageone;

import org.openqa.selenium.WebDriver;


public class Firstclass {
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        WebDriver driver= new chromedriver();
    }
}
mbuechmann
  • 5,413
  • 5
  • 27
  • 40

1 Answers1

0
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Firstclass {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");

        WebDriver driver= new ChromeDriver();
    }
}

Differences:

Line 2 - added import for ChromeDriver (your IDE should suggest you)

Line 7 - added path to crhrome driver; Don't forget to replace "/path/to/chromedriver" with a real FULL path to executable of crhomeDriver

Line 8 - new chromeDriver() ---> new ChromeDriver();

Ready examples of starting chromeDriver

Vladimir Efimov
  • 797
  • 5
  • 13