1
import org.openqa.selenium.chrome.ChromeDriver;

public class launch {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        ChromeDriver driver = new ChromeDriver();
        driver.get("https://www.google.com/");
    }
}

Error:

Could not find or load main class org.openqa.grid.selenium.GridLauncherV3
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

2 Answers2

1

In the Launch class you are directly creating the object of ChromeDriver class without giving the chrome driver path. So, before creating the ChromeDriver object you need to add:

System.setProperty("webdriver.chrome.driver","path of chromedriver.exe file");

If you have downloaded the chrome driver exe file then you need to pass that path. After this create the object of ChromeDriver class.

Apps Maven
  • 1,314
  • 1
  • 4
  • 17
0

You need to set the system property webdriver.chrome.driver as follows:

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

Additionally, instead of using the ChromeDriver use the WebDriver interface as follows:

WebDriver driver = new ChromeDriver();
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352