i'm getting this error when i am trying to run my first script.Can anyone please help me
3 Answers
Give the gecko driver path before creating the object for the driver. Use
System.setProperty("webdriver.gecko.driver", "path to your gecko driver");
to declare the driver path.
-
yeah.. after setting the gecko driver path, it runs successfully..but as per the tutorial i also tried to set the environment variable in system properties..but that didn't worked Jul 18, 2018 at 10:27
The code you have written might have worked if you would have used Firefox version lesser than 48 and webdriver 3. At that time firefox driver was implemented as a xpi based plugin; that was the reason why it was different from IE and Chrome where you explicitly needed to set the system property.
In short if you want to fix the issue, please add the below code to your class.
System.setProperty("webdriver.gecko.driver", "path to your gecko driver");
Unable to see error message properly, my guess is you didn't set gecko driver path in environment variables maybe