Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

The path to the driver executable must be set by the webdriver.gecko.driver system property

Ads

 
 

Share on Google+Share on Google+

Java Coder
The path to the driver executable must be set by the webdriver.gecko.driver system property
1 Answer(s)      9 months 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


Ads









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
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
Advertisements
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  
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
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...  
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> <
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. 
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
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
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
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
Driver
Driver  can u send type4 jdbc driver class name and url for microsoft sql server 2008
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     
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
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
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
System
System  What is System in System.out.println() method? Is it a Class or a Package
Class Path - Java Beginners
Class Path  Hello I was able to set the class path as You have......; there u can type the path both in user variables for administrator   Hi,one of the best thing i know is to set classpath in system itself meansi'll tell u
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
path classpath
, Path is system wide variable that tells where to find your commands. Lets...path classpath  EXPLAIN PATH AND CLASSPATH ? DIFF send me ans plz... be in path. While Classpath is Enviroment Variable that tells JVM or Java Tools where
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 nsinteger
@property nsinteger  Hi, How to declare @property nsinteger? Thanks... myvariable; } @property (nonatomic) NSInteger myvariable; @end Thanks   ...; } @property (nonatomic) NSInteger myvariable; @end Thanks
Class path
be used to set the class path. Class pathcan be set using either by using... Multiple path entries are separated by semi-colons. With the set command... the current directory in the search path, you must include "." in the new
Java Get Class path
Java Get Class path       In this section, you will learn how to get the class path. The method System.getProperties() determines the current system properties. 
Version of com.mycodefu>executable-jar-archetype dependency
List of Version of com.mycodefu>executable-jar-archetype dependency