I created a MavenTestProject in Eclipse with these dependencies:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
In MyTest01.java I tried to instantiate the FirefoxDriver:
WebDriver driver = new FirefoxDriver();
and I got this error:
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property;...
I tried this code, but it didn't work also:
System.setProperty("webdriver.gecko.driver", "selenium-firefox-driver-3.141.59.jar");
WebDriver driver = new FirefoxDriver();
I got this error:
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\Users\ofiman\eclipse-workspace\MavenTestProject\selenium-firefox-driver-3.141.59.jar
What can I do to get an instance of my FireFoxDriver?
Thanks in advance.