Please do help me over this guyss

48 views
Skip to first unread message

SHIVENDER SINGH

unread,
Jan 16, 2017, 4:48:26 AM1/16/17
to Selenium Users
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;


public class SELENIUM_17 {

public static void main(String[] args) 
{
   System.setProperty("webdriver.gecko.driver","C://selenium tutorials//geckodriver.exe");
WebDriver driver = new FirefoxDriver();
   driver.findElement(By.xpath(".//*[@id='gbw']/div/div/div[1]/div[1]/a")).click();
   driver.close();
}

}

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
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 SELENIUM_17.main(SELENIUM_17.java:10)

Ramesh Sankar

unread,
Jan 16, 2017, 4:51:06 AM1/16/17
to seleniu...@googlegroups.com
Hi,

You need to update like as  single foraward slash   C:/selenium tutorials/geckodriver.exe

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8e359b2b-14b6-457e-8792-ccdcb6cf1322%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

praveen kumar cherukuri

unread,
Jan 16, 2017, 4:53:36 AM1/16/17
to seleniu...@googlegroups.com
For me, everything looks good. But I suspect the "space" in the path of the gecko driver. .

Try to keep it in a simple path (like under c:\<somenamewithoutspace>\geckodriver.exe ) 
 
secondly, the url.. there is no need to give the query parameter for the google url. We can skip that. 


Rajesh Kuchana

unread,
Jan 18, 2017, 9:59:37 AM1/18/17
to Selenium Users
Hi ,

Please check preconditions it will work in java 8+ version only,in case you are using java7 then it will not work
Reply all
Reply to author
Forward
0 new messages