new FirefoxDriver() not working

187 visualitzacions
Ves al primer missatge no llegit

mark czerwin

no llegida,
23 d’ag. 2016, 5:34:3423/8/16
a Selenium Users
I'm using the Beta 3 version with Gecko on windows10

This code just terminates at this line driver =new FirefoxDriver();
I assume a null pointer exception is given
Firefox is not invoked 

package seleniumPackage;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;



public class NewWebDriverClass {

public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.gecko.driver", "c:\\temp");
driver =new FirefoxDriver();
driver.get("http://google.com");
System.out.println(driver.getTitle());
driver.close();

}

}

Any help much appreciated.

Aniket Mane

no llegida,
23 d’ag. 2016, 5:47:0023/8/16
a seleniu...@googlegroups.com

Mark,
As a second parameter of setproperty you should give path upto geckodriver exe.


System.setProperty("webdriver.gecko.driver", "c:\\temp");

--
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/b35bcfee-70f5-436a-907f-4accab1bad32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mark czerwin

no llegida,
23 d’ag. 2016, 5:51:4723/8/16
a seleniu...@googlegroups.com

Thanks for the reply, but that is what I am doing the path is c:\temp

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/51KxSH-I48U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJ5sn7SqJeUWrj%2B%3Due4ZD2R%2BhBq1eQzsLb6iE%3Dy0HOiTbB3TVA%40mail.gmail.com.

⇜Krishnan Mahadevan⇝

no llegida,
23 d’ag. 2016, 6:07:4323/8/16
a Selenium Users
Mark,

Can you please share the complete stacktrace ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

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.

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/51KxSH-I48U/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
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/CY4PR1601MB1223FFC8DD27FAEBD2F462C8B7EB0%40CY4PR1601MB1223.namprd16.prod.outlook.com.

Ashish Juyal

no llegida,
23 d’ag. 2016, 6:09:2923/8/16
a seleniu...@googlegroups.com
Hi Mark,
                selenium webdriver comes default with firefox driver you dont have to mention setProperty for ff driver,check the compatibility of webdriver and browser may be thats the issue.


Regards
Ashish Juyal

mark czerwin

no llegida,
23 d’ag. 2016, 6:25:0323/8/16
a Selenium Users
I'm using the latest driver with the latest Firefox
Without the setProperty it still fails
Stacktrace....
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:245)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:220)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:215)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:124)
at seleniumPackage.NewWebDriverClass.main(NewWebDriverClass.java:14)

Ashish Juyal

no llegida,
23 d’ag. 2016, 6:32:1823/8/16
a seleniu...@googlegroups.com
Hi Mark,
                 Try the below code for gecko driver.

System.setProperty("webdriver.gecko.driver","C:\\Work\\WORK\\Selenium\\geckodriver.exe");
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", true);
        WebDriver driver = new FirefoxDriver(capabilities);
        driver.get("http://www.google.com");


Regards
Ashish Juyal

mark czerwin

no llegida,
23 d’ag. 2016, 6:44:1423/8/16
a seleniu...@googlegroups.com

Thanks,

From this I determined that the actual executable name: gecko.exe needs to be in the path set as the second parameter to setProperty. So not only does the path to the executable need to be specified but the actual executable name itself, this is not the way system variables which are paths work normally.

System.setProperty("webdriver.gecko.driver", "c:\\temp\\geckodriver.exe");

That worked.

The SeleniumHQ documentation needs to be updated to explain that the Geckodriver is necessary and how to use it.

 

From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Ashish Juyal


Sent: Tuesday, August 23, 2016 3:32 AM
To: seleniu...@googlegroups.com

--

You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/51KxSH-I48U/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKw4ajLY1J%2B_iAAAzHYzgBa1XvjWMD2VBsW30DDFRPkweRJj9Q%40mail.gmail.com.

Aniket

no llegida,
23 d’ag. 2016, 7:24:5923/8/16
a Selenium Users
Mark,
Thats what i had told you.
You have to give path upto the exe.
But its good that its working now.


On Tuesday, August 23, 2016 at 4:14:14 PM UTC+5:30, mark czerwin wrote:

Thanks,

From this I determined that the actual executable name: gecko.exe needs to be in the path set as the second parameter to setProperty. So not only does the path to the executable need to be specified but the actual executable name itself, this is not the way system variables which are paths work normally.

System.setProperty("webdriver.gecko.driver", "c:\\temp\\geckodriver.exe");

That worked.

The SeleniumHQ documentation needs to be updated to explain that the Geckodriver is necessary and how to use it.

 

From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Ashish Juyal
Sent: Tuesday, August 23, 2016 3:32 AM
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] Re: new FirefoxDriver() not working

 

Hi Mark,

                 Try the below code for gecko driver.

 

System.setProperty("webdriver.gecko.driver","C:\\Work\\WORK\\Selenium\\geckodriver.exe");
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", true);
        WebDriver driver = new FirefoxDriver(capabilities);
        driver.get("http://www.google.com");

 

 

Regards

Ashish Juyal

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/51KxSH-I48U/unsubscribe.

To unsubscribe from this group and all its topics, send an email to selenium-use...@googlegroups.com.
To post to this group, send email to seleni...@googlegroups.com.

Respon a tots
Respon a l'autor
Reenvia
0 missatges nous