Unable to launch firefox by using RemoteWebDriver+geckodriver+selenium 3

10,460 views
Skip to first unread message

mahadi

unread,
Sep 30, 2016, 6:27:17 PM9/30/16
to Selenium Users
Hello all,

I am using:
- selenium-server-standalone-3.0.0-beta4.jar
- geckodriver (v0.10.0)
- Firefox 49.0
- Mac - OSX EI Captain
- JRE 1.8

Code:

System.setProperty("webdriver.gecko.driver", "/Users/mahadihasan/Downloads/geckodriver");

DesiredCapabilities capabilities = DesiredCapabilities.firefox();

capabilities.setCapability("marionette", true);


WebDriver driver = new RemoteWebDriver(new URL("http://192.168.1.1:4444/wd/hub"), capabilities);

driver.get("http://google.com");


But the test failed launch Firefox browser:

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}], required capabilities = null

Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:30:04 -0700'

System info: host: 'Mahadi.local', ip: '192.168.1.9', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_91'

Driver info: driver.version: RemoteWebDriver

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:80)
at org
.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602)

at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)

at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)

at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:156)



Selenium server log:
00:20:27.063 INFO - Executing: [new session: Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}]])
00:20:27.078 INFO - Creating a new session for Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}]
00:20:27.435 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:29:23 -0700'
System info: host: 'Mahadi.local', ip: '192.168.1.9', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_91'
Driver info: driver.version: unknown
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
.
.
.
       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:86)
        ... 9 more
Caused by: 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 was double checked geckodriver path, its there. Its a blocker for me now to proceed. It would be great if anyway can help whats going wrong. 

Thanks in advanced.

Best Regards,
Mahadi Hasan

KY07

unread,
Oct 2, 2016, 1:00:01 PM10/2/16
to Selenium Users
First of all, I think the url used in your remote driver is not the expected one. I think you should use the node's URL instead of the hub's one.
Second, I had the same issue described here while playing with grid and I solved it by passing the driver(s) info to the node's during its startup:
java -Dwebdriver.gecko.driver=MY_GECKO_ABSOLUTE_PATH -Dwebdriver.chrome.driver=MY_CHROME_ABSOLUTE_PATH -jar selenium-xyz.jar -role webdriver -hub MY_HUB_SERVER_IP:PORT/grid/register -port 5566 (or any other available port)

You'll then have to run it like this:
      DesiredCapabilities caps = DesiredCapabilities.firefox();//use your preferred browser
      caps.setBrowserName("firefox");//AGAIN, use the right browser name that you can get from the hub's config page
      caps.setPlatform(Platform.VISTA);//use the appropriate platform's name that you can get from the hub's config page
     
      this.driver = new RemoteWebDriver(new URL("http://192.168.1.50:5566/wd/hub"), caps);    //replace the url by your own node's url

mahadi

unread,
Oct 3, 2016, 11:09:25 AM10/3/16
to Selenium Users
This helps me, thanks

rajasekaran rj

unread,
Oct 12, 2016, 10:45:01 PM10/12/16
to Selenium Users
Hi Mahadi,

I am also facing the same problem. Tried to resolve hardly but no luck. Can you please elloboarate how you resolved it. Thanks.

Regards,
Rajasekaran

mahadi

unread,
Oct 13, 2016, 8:22:47 AM10/13/16
to Selenium Users
It works for me simply start the server by specifying the gecko driver path:

example: 

java -Dwebdriver.gecko.driver=MY_GECKO_ABSOLUTE_PATH -jar selenium-xyz.jar

rajasekaran rj

unread,
Oct 17, 2016, 2:35:52 AM10/17/16
to Selenium Users


On Thursday, October 13, 2016 at 5:52:47 PM UTC+5:30, mahadi wrote:
It works for me simply start the server by specifying the gecko driver path:

example: 

java -Dwebdriver.gecko.driver=MY_GECKO_ABSOLUTE_PATH -jar selenium-xyz.jar


On Thursday, October 13, 2016 at 4:45:01 AM UTC+2, rajasekaran rj wrote:
Hi Mahadi,

I am also facing the same problem. Tried to resolve hardly but no luck. Can you please elloboarate how you resolved it. Thanks.

Regards,
Rajasekaran

Hi Mahadi,

Could you please share your updated code to start the Remote firefox browser.

Thanks,

Ramesh P

unread,
Oct 19, 2016, 4:56:14 AM10/19/16
to Selenium Users
Hi,

I am unable to bypass the SSL Certification using GECKODriver. Kindly Help
FF-58
Selenium standalone server 3.0.1
Geckodriver 0.11


Regards,
Ramesh

Deepa Padmanabhan

unread,
Oct 26, 2016, 11:46:02 PM10/26/16
to Selenium Users

I am using:
- selenium-server-standalone-3.0.1.jar
- geckodriver (v0.11.0)
- Firefox 42.0
- Mac - OSX EI Captain
- JRE 1.8

I also set gecko driver while starting up the server and still face this issue

⇜Krishnan Mahadevan⇝

unread,
Oct 27, 2016, 3:30:30 AM10/27/16
to Selenium Users
GeckoDriver is meant to be used with Firefox v48 or higher [ if I remember correctly ]

Firefox 47.0.1 is known to work without the need for GeckoDriver when coupled with using 2.53.1 version of Selenium.

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/

--
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/366e2fd6-b0df-4526-b054-9ec72538e16a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Tolfsen

unread,
Oct 27, 2016, 8:50:44 AM10/27/16
to seleniu...@googlegroups.com, ⇜Krishnan Mahadevan⇝
⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> writes:

> GeckoDriver is meant to be used with Firefox v48 or higher [ if I
> remember correctly ]

The more recent the Firefox, generally the better the experience using
geckodriver will be.

There are certain patches available in more recent Firefox versions
that have not been backported/uplifted to earlier versions. For this
reasons, I recommend using Nightly when using geckodriver, which you
can get as a tarball here:

https://nightly.mozilla.org/

Vinoth Kumar

unread,
Dec 1, 2016, 1:17:56 AM12/1/16
to Selenium Users
It helps me perfectly to run my test in node device. but i can run only with one browser. i wonder if i get solution to run multiple browser with multiple nodes...

thanks in advance if it possible.

Lukus

unread,
Dec 13, 2016, 2:29:55 PM12/13/16
to Selenium Users
For me, the fix here was to remove the /wd/hub in the URL.

So, running geckdriver manually with -vv flag I could see the error:

1481656855494 webdriver::server DEBUG Returning body {"error":"unknown command","message":"POST /wd/hub/session did not match a known command"}


saw that it should not have /wd/hub but just /session.

So worked when called like this:

WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:4444"), caps); //no /wd/hub

Usha Brahma

unread,
Dec 31, 2016, 12:51:16 AM12/31/16
to Selenium Users
Hi KY07,

Thank you so much. This solved my issue.

Rupesh Trivedi

unread,
Feb 15, 2017, 2:12:25 AM2/15/17
to Selenium Users
I'm still having same issue, tried multiple solutions from google not sure whats wrong, can you please help?

Ullas Krishnan

unread,
Mar 22, 2017, 10:35:05 PM3/22/17
to Selenium Users
Thanks


On Monday, October 3, 2016 at 8:39:25 PM UTC+5:30, mahadi wrote:

Ullas Krishnan

unread,
Mar 22, 2017, 10:35:05 PM3/22/17
to Selenium Users
If this is not yet resolved, could you share the log details . The suggestion given by Ky works for me .

Andreas Tolfsen

unread,
Mar 23, 2017, 6:55:33 AM3/23/17
to seleniu...@googlegroups.com
Also sprach Ramesh P <rames...@gmail.com>:

> I am unable to bypass the SSL Certification using GECKODriver.
> Kindly Help
> FF-58
> Selenium standalone server 3.0.1
> Geckodriver 0.11

Firefox 58 hasn’t shipped yet, so I’m a bit surprised you’re using
that. Ensure you’re using the latest Firefox nightly, Selenium
3.3.1 or newer, and geckodriver 0.15.0.

We recently made some backwards incompatible changes to geckodriver
in order to conform with the W3C WebDriver standard, causing earlier
versions of Selenium to break.

Once you had the right versions of the software, all you need to do
is to pass an additional capability, acceptInsecureCerts, set to
true, like this:

{"acceptInsecureCerts": true}

Jayakrishnan Nair

unread,
Jun 8, 2017, 2:03:49 AM6/8/17
to Selenium Users
hi,
   I am also facing similar issue , with combination Firefox 53+latest Gecko driver+selenium3.4. I have suspected my DesiredCapability object has some parameter missing.


    static RemoteWebDriver createWebDiverInstance(Map<String,String> Configdata,DesiredCapabilities cap){
          RemoteWebDriver driver =null;
          String client= (String)Configdata.get("browser");
             if(client.equals("firefox")){
                System.setProperty("webdriver.gecko.driver","D:\\JavaSeleniumSetup\\geckodriver.exe");
               
                  FirefoxProfile profile= new FirefoxProfile();
                 try {
                      Firebug.configure(new File("D:\\old_machine\\firfoxext"), profile);
                 
                  } catch (IOException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
                 FireFoxBrowserProfile.setAutomaticDownloadProfile(profile, (String)Configdata.get("downloadDir"));
                 FireFoxBrowserProfile.setProxyProfile(profile, (String)Configdata.get("host"),Integer.parseInt(Configdata.get("portnumber")));
                 cap.setCapability(FirefoxDriver.PROFILE, profile);
                 cap.setCapability("marionette", true);
                 System.out.println(Configdata.get("grid"));
                 try {
                    driver  =  new RemoteWebDriver(new URL(Configdata.get("grid")), cap);
                      
                } catch (MalformedURLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                 driver.manage().window().maximize();
                 return driver;       
             }
       
        return null;
         
    }
   

org.openqa.selenium.SessionNotCreatedException: InvalidArgumentError: Expected [object Undefined] undefined to be an integer
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'IND-JNAIR', ip: '10.22.183.35', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver
remote stacktrace: stack backtrace:
   0:           0x489f6f - <no info>
   1:           0x48ad59 - <no info>
   2:           0x43a15d - <no info>
   3:           0x4474c9 - <no info>
   4:           0x445208 - <no info>
   5:           0x41ddb1 - <no info>
   6:           0x4091c7 - <no info>
   7:           0x6bc939 - <no info>
   8:           0x415a19 - <no info>
   9:           0x6b6e43 - <no info>
  10:         0x76e759cd - BaseThreadInitThunk
Command duration or timeout: 21.58 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'IND-JNair', ip: '10.22.183.35', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:158)
    at com.saba.ras.selenium.SabaWebDriverFactory.createWebDiverInstance(SabaWebDriverFactory.java:40)
    at com.saba.ras.selenium.SabaSelenium.beforestart(SabaSelenium.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:298)
    at org.testng.SuiteRunner.run(SuiteRunner.java:261)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
    at org.testng.TestNG.run(TestNG.java:1048)
    at com.saba.ras.executors.AdminCourseDashboardExecutor.run(AdminCourseDashboardExecutor.java:50)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

ANKIT SINGH

unread,
Jun 15, 2017, 6:48:42 AM6/15/17
to Selenium Users
Use firefox 51.0 with updated geckodriver.
It will definitely work.
But still you may face certificate-issue, if your URL need to handle certificate.
Regards,
Ankit Singh

TINKU

unread,
Jun 6, 2019, 1:06:04 AM6/6/19
to Selenium Users
Ff 67
Gecko 24
Selenium 3.141.59

Running the standalone server jar.


Unable to create a ff session. It saying connection refused

Please help I am into a loop trying to solve this issue..

TINKU

unread,
Jun 8, 2019, 3:28:43 PM6/8/19
to Selenium Users
same issue and in loop for more than. 5 days..

Ff67.0.1
Sell 3.141.59
Gecko 0.24

Are they all compatible???

Reply all
Reply to author
Forward
0 new messages