[js] Support for custom path for the geckodriver executable

62 views
Skip to first unread message

Ray Tung

unread,
Sep 24, 2016, 5:39:54 PM9/24/16
to Selenium Developers
Hi, all :)

Looking at the source code, the library currently looks for the geckodriver executable in the PATH and in the current directory (via process.cwd()).
Is there a reason to why there isn't a feature that allows users to provide their custom geckodriver path?

There's currently a useGeckodriver(bool) in firefox.Options(). It would be wonderful if we can pass in the path to the executable there.
e.g.

let options = new firefox.Options()
              .setBinary(/*some binary*/)
              .setProfile(/*some profile*/)
              .useGeckodriver('some/path/here/geckodriver');

let driver = new firefox.Driver(options);


Andreas Tolfsen

unread,
Sep 24, 2016, 7:27:34 PM9/24/16
to selenium-...@googlegroups.com, Ray Tung
Ray,

First of all I want to say that I didn’t do the coding of this, but I
want to offer my ideas on what I think is the right path for the future.

Ray Tung <ray.t...@gmail.com> writes:

> Looking at the source code, the library currently looks for the
> geckodriver executable in the PATH and in the current directory (via
> process.cwd()). Is there a reason to why there isn't a feature that
> allows users to provide their custom geckodriver path?

Right now we’re in a transition phase, and transitions are never
painless.

Firefox 47.0.1 and below only works with FirefoxDriver, and versions
after only support geckodriver. In fact, we are explicitly saying to
continue using FirefoxDriver if you need to use an earlier Firefox, and
also saying the more recent Firefox, the better chance of Marionette
functioning correctly.

I don’t think there’s a need for a choice at all in this matter. If we
can detect the version of Firefox, we should choose the right option
for the user implicitly.

> There's currently a useGeckodriver(bool) in firefox.Options(). It
> would be wonderful if we can pass in the path to the executable there.
> e.g.
>
> *let* options = *new* firefox.Options()
> .setBinary(/*some binary*/)
> .setProfile(/*some profile*/)
> .useGeckodriver('some/path/here/geckodriver');

I don’t think this is a bad idea if useGeckodriver is already an API,
but I think was a mistake to publish this API to begin with, as
non-geckodriver usage will very soon become history.

Let’s keep in mind that web browsers are a fresh commodity.

⇜Krishnan Mahadevan⇝

unread,
Sep 25, 2016, 11:04:30 AM9/25/16
to selenium-...@googlegroups.com
Ray,

You should still be able to pass in a custom location of the geckodriver via the JVM argument -Dwebdriver.gecko.driver
Is that what you are looking for?

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 Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developers+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/20160925002728.790572ef7505753f28644487%40mozilla.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages