User124235 User124235 - 1 year ago 113
Java Question

Selenium in java eclipse linux

I have the following error enter image description here

and here is my code

import org.openqa.*;
import org.openqa.selenium.WebDriver;
public class io {

* @param args
public static void main(String[] args) {
WebDriver driver=new ChromeDriver();



I mention that this error appear only when a do "new ChromeDriver()" .If i let without that it don't do that and i don't know what i need to do to solve it.Please help.

EDIT: After i dowloaded the chrome driver when i execute the program it works fine but when i am debugging it suspend.Why this happens?

Answer Source

You have to set the System property before creating an instance of the chrome driver. Download chromedriver in your machine and add below line to your code before initializing the chromedriver.

    System.setProperty("","<path to chromedriver>");

Hope it helps.