Java Coder
The path to the driver executable must be set by the webdriver.gecko.driver system property
1 Answer(s)      3 months and 12 days ago
Posted in : Java Beginners

Hi,

How to solve following error while using the selenium for testing application?

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
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:247)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:242)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:238)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
    at com.newstrackindia.TestLoginApp.main(TestLoginApp.java:15)

Thanks

Ads

View Answers

October 14, 2016 at 7:41 AM


Hi,

You should download geckodriver from https://github.com/mozilla/geckodriver/releases

Then extract in a folder and use following code:

WebDriver driver;
        System.setProperty("webdriver.gecko.driver", "C:\\DeepakData\\selenium\\geckodriver.exe");
        driver =new FirefoxDriver();

This will solve the issue.

Thanks










Related Tutorials/Questions & Answers:
The path to the driver executable must be set by the webdriver.gecko.driver system property
The path to the driver executable must be set by the webdriver.gecko.driver..." 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
Set properties for a JDBC driver
Set properties for a JDBC driver  How do I set properties for a JDBC driver and where are the properties stored
Advertisements
property in javascript get set
property in javascript get set  How to create the get and set property in JavaScript?   Creating Get and Set properties in JavaScript example.. myVar Sample = { nval : "", get get() { return this.nval; }, set
how to set class path
how to set class path  how to set class path in java
SPEL-System Property
Accessing System Property Using SpEL Spring 3 provides powerful Expression...;); System.out.println("System Property 'myProperty' Value: "+myObj.getProp...: ------------------------------------- System Property 'myProperty' Value: xyz
Java example to get the execution path
path of the system in java by using the system property. For getting execution path we have used "user.dir" property of the system. Here... Java example to get the execution path  
Spring Set Property
Spring Set Property The Spring Framework has bean support for the Collections. It provide list, set, map and props elements. Here in this tutorial you will see about the set elements which is used to set values inside the set
JSP bean set property
JSP bean set property   ... you a code that help in describing an example from JSP bean set property... a setter and getter method. set XXX ( ): This method hold
set a class path - Development process
set a class path   thanks u sir i got a .jar file,but while declareing a HSSFWorkbooks wb = new HSSFWorkbooks(); i m getting a error in eclipse .how to set a classpath for that please help me sir thanks in advance...  
how to set fetch size for jdbc odbc driver
how to set fetch size for jdbc odbc driver  What is the default fetch size for the JDBC ODBC driver and how can i fetch a set of results for JDBC ODBC driver?   Fetching results JDBC ODBC Driver A. The default fetch
Java program to get the desktop Path
the desktop path of the system. In the java environment we can get the desktop path also with the system's property. For getting the desktop path we have to add... Java program to get the desktop Path  
how to set the class path variable in tomcat ?
how to set the class path variable in tomcat ?  description...="test" property="message" value... name="test" property="message" /> </center> </body> <
Why GPS Tracking System is a must for Fleet Managers in Fleet Management?
Why GPS Tracking System is a must for Fleet Managers in Fleet Management, its... why GPS Tracking System is a must for Fleet Managers in Fleet Management... in the field of fleet management and to sustain in this competition one must exploit all
Java get set Properties
;  In this section, you will learn how to modify the set of system... Pvt Ltd which is not an actual System Property.  Properties... properties object, prop with the current set of system properties. 
Driver
Driver  can u send type4 jdbc driver class name and url for microsoft sql server 2008
pls provide common path to set image in flex - XML
pls provide common path to set image in flex  hi, pls provide...\mannai1\src\pictures\useful_links_logo.gif .it works nicely.but when i set path... the coding in mxml to set common path of image in flex
How to use Sigma grid built-in capabilities to calculate aggregates where Sortable property set to TRUE
Sortable property set to TRUE  How to use Sigma grid built-in capabilities to calculate aggregates where Sortable property set to TRUE, So that We can also...: but here Sortable property has been set to false. I need to implement
Creating an executable jar file
Creating an executable jar file  When I try to create jar.exe through CMD, the manifest file created doesn't contain Main-Class attribute, even though it is included in text file used during creation of jar file
Changing Executable Jar File Icon
Changing Executable Jar File Icon  I have created an executable jar file for my java program and the icon that appears is the java icon. I will like...;Hi, You may use JSmooth to create executable java file and also associate icon
PHP is_executable() Function and example
Syntax bool is_executable(file_name) Find the PHP is_executable() function states whether the given file is executable or not Example of PHP is_executable Fu Code <?php     if (is_executable("c
which path we have to give in order to upload a file from any where in the system
which path we have to give in order to upload a file from any where... to specifying a path in the code from that path only it is taking image . what i have to do in order to upload a image from any where from the system Please tell me
conversion of war file into executable jar file
conversion of war file into executable jar file  how to convert war file into executable jar file
how to create executable - Java Beginners
how to create executable  How do i create a executable file from a java file thnks in adv...!  Hi Friend, Try the following code: import java.io.*; import java.util.jar.*; public class CreateExe { public
How to embed an executable plugin in my website?
How to embed an executable plugin in my website?  I want to embed an executable plugin in my website that will return client's Mac address run time. I am working with jsp/servlet. Please Help
jdbc driver
jdbc driver  hello, can we create a own jdbc driver? how can we create
error in driver
error in driver  i have done connection settings for oraclethin driver in netbeans ide 6.9.1. and i was able to view tables of my database.but when i am trying to access tables from my java class i was getting error
no driver - JDBC
{ try { //Loads Type 2 Driver Class.forName...) { System.err.println("Could not load DB2 driver! \n"); System.err.println(e.getMessage()); System.exit(1); } /* Type 2 driver url */ //String url
@property nsinteger
@property nsinteger  Hi, How to declare @property nsinteger? Thanks... myvariable; } @property (nonatomic) NSInteger myvariable; @end Thanks   ...; } @property (nonatomic) NSInteger myvariable; @end Thanks
Displaying System Files in JTree
that displays system files. The java.util.properties package represents a persistent set of properties for displaying the system files in a tree. Description... Displaying System Files in JTree     
Spring Date Property
Spring Date Property Passing a date format in the bean property is not allowed and to do so you need to declare a dateFormat bean and reference it as factory bean from its date property that is set in bean property
Property File
Property File  how to store key & values pair in property file? Note: In property file keys should be displayed in ascending order. please reply the answer as soon as possible. Thanking You   import java.io.