Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I am trying to launch Mozilla but still, I am getting 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; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases

I am using  Selenium 3.0.01 Beta version and Mozilla 45 I have tried with Mozilla 47 toobut still the same thing.

1 Answer

0 votes
by (62.9k points)

Selenium WebDriver Java code:

  1. Download Gecko Driver from https://github.com/mozilla/geckodriver/releases based on your platform. 
  2. Extract it in a location by your choice. You will have a zip (or tar.gz) so extract it.
  3. After extraction, you will have geckodriver.exe file (appropriate executable in Linux).
  4. Create Folder in C: named SeleniumGecko (Or appropriate)
  5. Copy and Paste geckodriver.exe to SeleniumGecko
  6. Set the path for gecko driver as below
System.setProperty("webdriver.gecko.driver", "D:/geckodriver-v0.16.1-win64/geckodriver.exe"); 
WebDriver driver = new FirefoxDriver(); driver.get("https://intellipaat.com");

 

Hope this helps!

 

Browse Categories

...