1

Using Java for Selenium, and am curious about the firefoxdriver package. There are several python specific packages, but does firefoxdriver perhaps install the geckodriver to the system in a way which is easy for a Java based Selenium project to find?

I've been using a properties file:

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <comment>selenium config and vehicle type</comment>
    <entry key="gecko">/home/thufir/.gecko/geckodriver</entry>
    <entry key="url">http://books.toscrape.com/</entry>
    <entry key="driver">webdriver.gecko.driver</entry>
    <entry key="usr">admin</entry>
    <entry key="pwd">12345</entry>
    <entry key="option01">--headless</entry>
</properties>

Which would be slightly less fragile if it point to some standard place on the system. (I suppose it's probably possible to bundle it in the JAR, also.)

thufir@dur:~$ 
thufir@dur:~$ sudo apt install firefoxdriver
Reading package lists... Done
Building dependency tree       
Reading state information... Done
firefoxdriver is already the newest version (3.8.0-1).
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.
thufir@dur:~$ 
1
  • 1
    Have you tried dpkg -L firefoxdriver to see where all the package files are installed to? – user535733 Dec 26 '18 at 20:35
1

The firefoxdriver package in Debian GNU/Linux and Ubuntu only works with long obsolete versions of firefox. As far as I know, Ubuntu doesn't have a geckdriver package that works with current firefox versions, so you have to download them separately.Selenium should then automaticlaly use it as long as you start it yourself or it is in the path.

Official releases can apparently be found on github: https://github.com/mozilla/geckodriver/releases

0

Not exactly sure where the geckodriver file is, but it might be in there somewhere:

thufir@dur:~$ 
thufir@dur:~$ cat /usr/share/doc/firefoxdriver/README.Debian 
selenium-firefoxdriver for Debian
------------------------

This package contains the prebuilded shared objects for x386 and amd64 to
use firefox webdriver with e.g. python-selenium. Some of the shared objects
are packed inside the webdriver.xpi. The python bindings, which this package
is for, requires the path of all .so and select/copy them files by themself. 

The source for selenium-firefoxdriver is the same like the python-bindings but we filter out all other stuff except the webdriver.xpi.

 -- Sascha Girrulat <sascha@girrulat.de>  Sat, 22 Aug 2015 11:43:04 +0200
thufir@dur:~$ 
thufir@dur:~$ dpkg -L firefoxdriver
/.
/usr
/usr/lib
/usr/lib/firefoxdriver
/usr/lib/firefoxdriver/amd64
/usr/lib/firefoxdriver/amd64/x_ignore_nofocus.so
/usr/lib/firefoxdriver/webdriver.xpi
/usr/lib/firefoxdriver/x86
/usr/lib/firefoxdriver/x86/x_ignore_nofocus.so
/usr/share
/usr/share/doc
/usr/share/doc/firefoxdriver
/usr/share/doc/firefoxdriver/README.Debian
/usr/share/doc/firefoxdriver/README.rst.gz
/usr/share/doc/firefoxdriver/changelog.Debian.gz
/usr/share/doc/firefoxdriver/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/firefoxdriver
thufir@dur:~$ 

Better answer appreciated. There's an xpi file, which looks to be an installer for firefox(?) which might have the geckodriver compressed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.