Giter VIP home page Giter VIP logo

driver-binary-downloader-maven-plugin's Introduction

Selenium driver-binary-downloader-maven-plugin

Join the chat at https://gitter.im/Ardesco/selenium-standalone-server-plugin Build Status Maven Central Javadoc

A Maven plugin that will download the WebDriver stand alone server binaries for use in your mavenised Selenium project.

What's changed? See the Changelog.

This plugin now requires Java 8!

Default Usage

<plugins>
    <plugin>
        <groupId>com.lazerycode.selenium</groupId>
        <artifactId>driver-binary-downloader-maven-plugin</artifactId>
        <version>1.0.18</version>
        <configuration>
            <!-- root directory that downloaded driver binaries will be stored in -->
            <rootStandaloneServerDirectory>/my/location/binaries</rootStandaloneServerDirectory>
            <!-- Where you want to store downloaded zip files -->
            <downloadedZipFileDirectory>/my/location/zips</downloadedZipFileDirectory>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>selenium</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</plugins>

By default the plugin will download the most recent binary specified in the RepositoryMap.xml for every driver/os/bitrate. If you want to filter out the ones you don't need have a look at the advanced usage options below.

Advanced Usage

<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.selenium</groupId>
            <artifactId>driver-binary-downloader-maven-plugin</artifactId>
            <version>1.0.18</version>
            <configuration>
                <!-- root directory that downloaded driver binaries will be stored in -->
                <rootStandaloneServerDirectory>/tmp/binaries</rootStandaloneServerDirectory>
                <!-- Where you want to store downloaded zip files -->
                <downloadedZipFileDirectory>/tmp/zips</downloadedZipFileDirectory>
                <!-- Location of a custom repository map -->
                <customRepositoryMap>/tmp/repo.xml</customRepositoryMap>
                <!-- This will ensure that the plugin only downloads binaries for the current OS, this will override anything specified in the <operatingSystems> configuration -->
                <onlyGetDriversForHostOperatingSystem>false</onlyGetDriversForHostOperatingSystem>
                <!-- Operating systems you want to download binaries for (Only valid options are: windows, linux, osx) -->
                <operatingSystems>
                    <windows>true</windows>
                    <linux>true</linux>
                    <mac>true</mac>
                </operatingSystems>
                <!-- Download 32bit binaries -->
                <thirtyTwoBitBinaries>true</thirtyTwoBitBinaries>
                <!-- Download 64bit binaries -->
                <sixtyFourBitBinaries>true</sixtyFourBitBinaries>
                <!-- If set to false will download every version available (Other filters will be taken into account -->
                <onlyGetLatestVersions>false</onlyGetLatestVersions>
                <!-- Provide a list of drivers and binary versions to download (this is a map so only one version can be specified per driver) -->
                <getSpecificExecutableVersions>
                    <googlechrome>18</googlechrome>
                </getSpecificExecutableVersions>
                <!-- Throw an exception if any specified binary versions that the plugin tries to download do not exist -->
                <throwExceptionIfSpecifiedVersionIsNotFound>false</throwExceptionIfSpecifiedVersionIsNotFound>
                <!-- Number of times to attempt to download each file -->
                <fileDownloadRetryAttempts>2</fileDownloadRetryAttempts>
                <!-- Number of ms to wait before timing out when trying to connect to remote server to download file -->
                <fileDownloadConnectTimeout>20000</fileDownloadConnectTimeout>
                <!-- Number of ms to wait before timing out when trying to read file from remote server -->
                <fileDownloadReadTimeout>10000</fileDownloadReadTimeout>
                <!-- Overwrite any existing binaries that have been downloaded and extracted -->
                <overwriteFilesThatExist>true</overwriteFilesThatExist>
                <!-- Check file hashes of downloaded files.  Default: true -->
                <checkFileHashes>true</checkFileHashes>
                <!-- auto detect system proxy to use when downloading files -->
                <!-- To specify an explicit proxy set the environment variables http.proxyHost and http.proxyPort -->
                <useSystemProxy>true</useSystemProxy>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>selenium</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Custom RepositoryMap.xml

You should supply your own RepositoryMap.xml file, if you don't supply one a default one (which will most likely be out of date) will be used instead. Your RepositoryMap.xml must match the schema available at Here.

How do I get the SHA1/MD5 hashes for the binaries I ant to download?

The people providing the binaries should be publishing MD5/SHA1 hashes as well so that you can check that the file you have downloaded is not corrupt. It seems that recently this does not seem to be happening as a matter of course. If you can't find a published SHA1/MD5 hash you can always download the file yourself, check that it is not corrupt and then generate the hash using the following commands:

On a *nix system it's pretty easy. perform the following command:

openssl md5 <filename>
openssl sha1 <filename>

On windows you can do the following (according to https://support.microsoft.com/en-us/kb/889768):

FCIV -sha1 <filename>
FCIV -md5 <filename>

Below is an example RepositoryMap.xml that I will endeavour to keep up to date so that you can just copy/paste the contents into your own file.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
    <windows>
        <driver id="internetexplorer">
            <version id="3.150.1">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://selenium-release.storage.googleapis.com/3.150/IEDriverServer_x64_3.150.1.zip</filelocation>
                    <hash>617f88598910dc2e77b25c5b4b653a0176025917</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://selenium-release.storage.googleapis.com/3.150/IEDriverServer_Win32_3.150.1.zip</filelocation>
                    <hash>2247b50a1fd05b51fd441e2a42e037be16fd7d70</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="edge">
            <version id="91">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://msedgedriver.azureedge.net/91.0.849.0/edgedriver_win64.zip</filelocation>
                    <hash>c4b2c31dc3bec1e914f08cda27e2c24a85eb892a</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://msedgedriver.azureedge.net/91.0.849.0/edgedriver_win32.zip</filelocation>
                    <hash>7cd00ff0716e137d55619e56008059d3ecd675d6</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="googlechrome">
            <version id="90">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/90.0.4430.24/chromedriver_win32.zip</filelocation>
                    <hash>0741cdedd5c3b5acf35bb4baf29b19d59b3d6371</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="operachromium">
            <version id="89">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/operasoftware/operachromiumdriver/releases/download/v.89.0.4389.82/operadriver_win64.zip</filelocation>
                    <hash>a257045198153c4ced64feaeafdda6dc7b02ef03</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://github.com/operasoftware/operachromiumdriver/releases/download/v.89.0.4389.82/operadriver_win32.zip</filelocation>
                    <hash>ff1fbd114ec4ecdeb11ce294f614c5cd655065b3</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="marionette">
            <version id="0.29.0">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-win64.zip</filelocation>
                    <hash>1e3062ac8262750463f05310ea3a8053a20f42e6</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-win32.zip</filelocation>
                    <hash>7036e1a6f5d87490e1267418cb0e303c9570d6ae</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </windows>
    <linux>
        <driver id="edge">
            <version id="91">
                <bitrate arm="true">
                    <filelocation>https://msedgedriver.azureedge.net/91.0.849.0/edgedriver_arm64.zip</filelocation>
                    <hash>2199480c20d2638c6478923b69aa6d439f3fb29d</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="googlechrome">
            <version id="90">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/90.0.4430.24/chromedriver_linux64.zip</filelocation>
                    <hash>50d02031681c8f32f20b5fa3ce35c29efc8fdb98</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="operachromium">
            <version id="89">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/operasoftware/operachromiumdriver/releases/download/v.89.0.4389.82/operadriver_linux64.zip</filelocation>
                    <hash>cbed52d82ab56734921b56cc75f5b62ea55ae988</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="marionette">
            <version id="0.29.0">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz</filelocation>
                    <hash>21590d1be8cfdf3f2d152790ce89aad5a7e563f9</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
                <bitrate thirtytwobit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux32.tar.gz</filelocation>
                    <hash>30c771284e1fee0ae2008410885a50f547b87253</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
            <version id="0.23.0">
                <bitrate arm="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-arm7hf.tar.gz</filelocation>
                    <hash>1788cb6756d72c50ac2408e0dc60b778cb40f626</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </linux>
    <osx>
        <driver id="edge">
            <version id="91">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://msedgedriver.azureedge.net/91.0.848.0/edgedriver_mac64.zip</filelocation>
                    <hash>6f90b11eaa91295e5adc523984db47bdd08ed05f</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="googlechrome">
            <version id="89">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/89.0.4389.23/chromedriver_mac64.zip</filelocation>
                    <hash>b0857b123b956317ed5a858bac400a6d9ad01f8c</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="operachromium">
            <version id="89">
                <bitrate sixtyfourbit="true">
                    <filelocation>https://github.com/operasoftware/operachromiumdriver/releases/download/v.89.0.4389.82/operadriver_mac64.zip</filelocation>
                    <hash>d3964b603632161fa3cfe3e516a03adc968ec8e6</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
        <driver id="marionette">
            <version id="0.29.0">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-macos.tar.gz</filelocation>
                    <hash>f6e624f20e2edd8ef09f7220c5aaed4d59023008</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </osx>
</root>

driver-binary-downloader-maven-plugin's People

Contributors

alexkress avatar aneesh-joseph avatar ardesco avatar gitter-badger avatar haroon-sheikh avatar hi-fi avatar mpkorstanje avatar nmichas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

driver-binary-downloader-maven-plugin's Issues

Version 1.0.13 doesn't respect RepositoryMap.xml content.

Version 1.0.12 (by the way your Changelog file has incorrect versions, e.g. it refers to 1.13.0 instead of 1.0.13) respects the content of custom RepositoryMap.xml :
I have only chromedriver specified there.
As a result only chromedriver is downloaded.
Version 1.0.13 downloads every windows driver even if it's not specified in the RepositoryMap.xml .

Here is the content of the RepositoryMap.xml :

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
    <windows>
        <driver id="googlechrome">
            <version id="2.29">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>http://chromedriver.storage.googleapis.com/2.29/chromedriver_win32.zip
                    </filelocation>
                    <hash>2f02f28d3ff1b8f2a63cb3bc32c26ade60ac4737</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </windows>
    <linux>
        <driver id="googlechrome">
            <version id="2.29">
                <bitrate sixtyfourbit="true">
                    <filelocation>http://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip
                    </filelocation>
                    <hash>025a098cde0a6ad8aef53d6734979c9845bf49b5</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </linux>
    <osx>
        <driver id="googlechrome">
            <version id="2.29">
                <bitrate thirtytwobit="true" sixtyfourbit="true">
                    <filelocation>http://chromedriver.storage.googleapis.com/2.29/chromedriver_mac64.zip
                    </filelocation>
                    <hash>cec18df4ef736d6712593faf91b462352217214a</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>
    </osx>
</root>

Only chrome driver should be downloaded. Nothing else.

More verbose logging if hash is wrong

related to issue #14

Next messages are not descriptive:

[INFO] Problem downloading 'IEDriverServer_x64_2.41.0.zip'... null
[ERROR] Unable to successfully downloaded 'IEDriverServer_x64_2.41.0.zip'!

Always downloads binary, even if previously downloaded

It's not clear to me if this is an issue or not. I notice that I'll see the following output on every test run:

[INFO] Preparing to download Selenium Standalone Executable Binaries...
[INFO] Downloading  'chromedriver_mac32.zip'...
[INFO] Archive file 'chromedriver_mac32.zip' is valid : true
[INFO] Binary 'chromedriver' Exists: true

If I'm understanding this correctly, it seems like the binary is being downloaded each time. Maybe this doesn't matter in the long run but sometimes testing is done on a purely local version of an environment.

For example, developers may run initial tests when they are connected (thus downloading the binaries). But then take their laptops with them and, even when not connected, run tests against a local version of the web application. That won't work, however, because the binaries are downloaded each time.

I'm not sure, but would it make sense to have it check if the binaries are already downloaded and, if so, simply use the existing if the existing matches what's in the RepositoryMap.xml?

Please add support for Firefox Marionette (the "wires" binary)

The next generation of the FirefoxDriver, currently called MarionetteDriver, also requires an external standalone server binary in order to work. The server binary is called "wires" and is available for Windows, Linux and Mac OS X.

Please add support for MarionetteDriver to this plugin, so that the "wires" executable can also be automatically downloaded by this plugin. Even though the (old/current) FirefoxDriver driver is still available for the time being, as I understand it, the MarionetteDriver is meant to eventually replace it. It would be nice to have support for it in place well beforehand.

For more information regarding Marionette, see these links:

Thank you in advance for considering this feature enhancement request.

Excellent plugin, by the way! :-) I like the idea of having a one-stop-shop for all required external sever executables for running Selenium tests with different browsers. It saves a lot of manual configuration work.

Make Hash Check Optional

Make the hash check on the downloaded file optional.

Default will be to perform the hash check.

Causes maven antrun to run more than once

Hi

I'm using Maven to not only download the WebDrivers, but also to launch Selenium. My POM file contains the following:

<build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.selenium</groupId>
                <artifactId>driver-binary-downloader-maven-plugin</artifactId>
                <version>1.0.7</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>selenium</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-antrun-plugin</artifactId>
             <version>1.7</version>
                <executions>
                    <execution>
                        <id>hub</id>
                        <phase>test-compile</phase>
                        <configuration>
                            <target>
                                <echo message="Launching Selenium Hub"/>
                                <java classname="org.openqa.grid.selenium.GridLauncher"
                                  classpathref="maven.test.classpath"
                                  failonerror="true"
                                  fork="false">
                                    <arg line="-role hub"/>
                                </java>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>node</id>
                        <phase>test-compile</phase>
                        <configuration>
                            <target>
                                <echo message="Launching Selenium Node"/>
                                <java classname="org.openqa.grid.selenium.GridLauncher"
                                  classpathref="maven.test.classpath"
                                  failonerror="true"
                                  fork="false">
                                    <arg line="-role node -nodeConfig selenium/${seleniumNodeConfig}"/>
                                </java>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

When I run mvn test, it fires up the Selenium Hub and Node, then downloads the binaries, then tries to fire up Selenium again, obviously failing because its already running (I don't want to turn off failonerror for that). Doesn't seem to matter how I change phases, this always happens. Any idea?

NullPointer exception in setRepositoryMapFile()

Using version 1.0.11

java.lang.NullPointerException at com.lazerycode.selenium.SeleniumServerMojo.setRepositoryMapFile(SeleniumServerMojo.java:290) at com.lazerycode.selenium.SeleniumServerMojo.execute(SeleniumServerMojo.java:193) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)

It looks like the checkRepositoryMapIsValid() method sets the customRepositoryMap field to null after it receives the IOException "java.net.ConnectException: Connection timed out: connect" when trying to validate the xmlFile.

I had added a DOCTYPE to my RepositoryMap.xml in an attempt to remove an eclipse validation warning. The DOCTYPE is what caused the connect time-out.
<!DOCTYPE root PUBLIC "-" "https://github.com/Ardesco/selenium-standalone-server-plugin/blob/master/src/main/resources/RepositoryMap.xsd">

I've removed it, which solves that problem, but thought I would point out the exception.

Cannot assign value 'null' (type: class java.lang.String) to protected java.util.Map com.lazerycode.selenium.SeleniumServerMojo.operatingSystems

I am still seeing this error:
Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:0.9.1:selenium (default) on project XYZ: Unable to parse configuration of mojo com.lazerycode.selenium:driver-binary-downloader-maven-plugin:0.9.1:selenium: Cannot assign value 'null' (type: class java.lang.String) to protected java.util.Map com.lazerycode.selenium.SeleniumServerMojo.operatingSystems: Can not set java.util.Map field com.lazerycode.selenium.SeleniumServerMojo.operatingSystems to java.lang.String -> [Help 1]

I have Googled this error, and I am not doing any of the things mentioned as the solutions. My paths do not have spaces. My pom.xml is here: https://sourceforge.net/p/genieos/code-0/HEAD/tree/trunk/demos/pom.xml (the downloader is currently commented out until I get this working).

I tried both with and without the operatingSystems element, with same results. I tried with specifying all and with specifying only one operating system, with same results.

I am using:
Apache Maven 3.1.0
Java version: 1.7.0_21, vendor: Oracle Corporation
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Downloaded drivers are not executable.

Just found this plugin and have set it up against my project, but the drivers are not executable.

I found 1 and it seems you pushed out version 0.91 with this feature, but it seems to have disappeared?

$ ls -lrt /Users/john/codebase/project/selenium-e2e/selenium_standalone/osx/googlechrome/64bit/
total 13520
-rwxr--r-- 1 john staff 6919952 24 Oct 20:45 chromedriver

ProxySelector.setDefault(null); will causes failure in other maven goal's httpclient creation.

The following code in selenium-standalone-server-plugin/src/main/java/com/lazerycode/selenium/download/DetectProxyConfig.java

causes failed httpclient creation when running another program in maven with your plugin. Errors will be like, (the reason is the default proxyselector has been set to null by your plugin.)

Caused by: java.lang.NullPointerException
at org.apache.http.impl.conn.SystemDefaultRoutePlanner.determineProxy(SystemDefaultRoutePlanner.java:79)
at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:73)
at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:126)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:215)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:165)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:362)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
... 63 more
===================error code piece======================
private Proxy getProxy() {
List proxyList = null;
try {
ProxySelector defaultProxy = ProxySelector.getDefault();
proxyList = defaultProxy.select(new URI("http://foo.bar"));
ProxySelector.setDefault(null); //<-----this will globally set the default ProxySelector to null which causes the other program in maven to fail when creating httpclient. In a sense of real-world use case, DefaultProxySelector should never be reset after system initialization. probably java should declare this variable to final type.
} catch (Exception ignored) {
}
if (null != proxyList) {
for (Proxy proxy : proxyList) {
if (null != proxy) {
return proxy;
}
}
}
return null;
}

PhantomJS binary is not executable

I am using just the vanilla โ€œdefault usageโ€ - nothing fancy - and version 1.0.12. Have this running on my machine (Mac) and everything works as expected.

Just ran this on my Jenkins (Linux), where I specifically need the headless PhantomJS.

The build gets stuck at:

[INFO] Archive file 'phantomjs-2.1.1-linux-x86_64.tar.bz2' is valid : true
[DEBUG] Determined archive type: BZ2
[DEBUG] Overwrite files that exist: false
[DEBUG] Decompressing .bz2 file
[DEBUG] Attempting to extract binary from a .tar file...
[DEBUG] Found: phantomjs-2.1.1-linux-x86_64/bin/phantomjs
[INFO] Extracting binary 'phantomjs'...

I gave it sufficient time, like 15 minutes. I killed the build and reran it. I see:

[INFO] Binary 'phantomjs' exists: true

However, then all the tests fail with:

java.lang.IllegalStateException: The driver is not executable: /selenium/bin/linux/phantomjs/64bit/phantomjs

I checked all the other binaries that were downloaded, and they all have correct execute permissions. PhantomJS is the only one that does not.

Firefox driver is not support

A very useful plugin for automating selenium testing.
But I can not figure out how to use this plugin to use firefox driver though the firefox is the default browser.

Error: Unable to find any expected files for marionette

Seeing the following error:

[ERROR] Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.9:selenium (default) on project foo-selenium: Unable to find any expected files for marionette -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.9:selenium (default) on project foo-selenium: Unable to find any expected files for marionette
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
    at java.lang.reflect.Method.invoke(Method.java:620)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: com.lazerycode.selenium.exceptions.ExpectedFileNotFoundException: Unable to find any expected files for marionette
    at com.lazerycode.selenium.extract.FileExtractor.unzipFile(FileExtractor.java:96)
    at com.lazerycode.selenium.extract.FileExtractor.extractFileFromArchive(FileExtractor.java:61)
    at com.lazerycode.selenium.download.DownloadHandler.downloadAndExtractExecutableFiles(DownloadHandler.java:127)
    at com.lazerycode.selenium.download.DownloadHandler.ensureStandaloneExecutableFilesExist(DownloadHandler.java:94)
    at com.lazerycode.selenium.SeleniumServerMojo.execute(SeleniumServerMojo.java:240)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more

This issue is only experienced on windows and not on osx. For more information see Ardesco/Selenium-Maven-Template#21

Plugin execution not covered by lifecycle configuration

I upgraded driver-binary-downloader-maven-plugin version to 1.0.0. In Eclipse the pom.xml shows an error marker:
Plugin execution not covered by lifecycle configuration: com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.0:selenium (execution: default, phase: test-compile)
The project fails to build in Eclipse.

I think this was there even in previous versions, so this is not a regression.

Any idea how to fix this?

Plugin causes test-compile to be executed twice

When using selenium-standalone-server-plugin 1.0.11 bound to the initialization phase it appears that the plugin causes the build to execute test-compile twice. This is causing me some trouble as some resources from cucumber-jvm-parallel-plugin should only be generated once and appears to be related to issue #30.

First we see the build run up to initialize at which point we see:

[INFO] >>> driver-binary-downloader-maven-plugin:1.0.11:selenium (default) > test-compile @ das-cucumber >>>

Then we see the resource, compile, testResources, testCompile followed by:

[INFO] <<< driver-binary-downloader-maven-plugin:1.0.11:selenium (default) < test-compile @ das-cucumber <<<

At this point the download actually starts and is followed by

[INFO] SELENIUM STAND-ALONE EXECUTABLE DOWNLOADS COMPLETE

Then we see the resource, compile, testResources, testCompile come by again.

For what it is worth, binding the binary downloader to any other phases causes the same problem, but at different moments.

mpkorstanje@Pnyx:~/das-cucumber$ mvn clean verify
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building das-cucumber 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ das-cucumber ---
[INFO] Deleting /home/mpkorstanje/das-cucumber/target
[INFO] 
[INFO] >>> driver-binary-downloader-maven-plugin:1.0.11:selenium (default) > test-compile @ das-cucumber >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mpkorstanje/das-cucumber/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ das-cucumber ---
[INFO] No sources to compile
[INFO] 
[INFO] --- cucumber-jvm-parallel-plugin:2.1.0:generateRunners (generate-runners) @ das-cucumber ---
[INFO] Adding /home/mpkorstanje/das-cucumber/target/generated-test-sources/cucumber to test-compile source root
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ das-cucumber ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /home/mpkorstanje/das-cucumber/target/test-classes
[INFO] 
[INFO] <<< driver-binary-downloader-maven-plugin:1.0.11:selenium (default) < test-compile @ das-cucumber <<<
[INFO] 
[INFO] --- driver-binary-downloader-maven-plugin:1.0.11:selenium (default) @ das-cucumber ---
[INFO]  
[INFO] --------------------------------------------------------
[INFO]  DOWNLOADING SELENIUM STAND-ALONE EXECUTABLE BINARIES...
[INFO] --------------------------------------------------------
[INFO]  
[INFO]  file:/home/mpkorstanje/das-cucumber/RepositoryMap.xml is valid
[INFO]  
[INFO] Only get drivers for current Operating System: true
[INFO] Getting drivers for current operating system only.
[INFO] Archives will be downloaded to '/home/mpkorstanje/das-cucumber/selenium_standalone_zips'
[INFO] Standalone executable files will be extracted to '/home/mpkorstanje/das-cucumber/selenium_standalone'
[INFO]  
[INFO] Preparing to download Selenium Standalone Executable Binaries...
[INFO] Binary 'chromedriver' Exists: true
[INFO] Using existing 'chromedriver'binary.
[INFO] Binary 'operadriver' Exists: true
[INFO] Using existing 'operadriver'binary.
[INFO] Binary 'phantomjs' Exists: true
[INFO] Using existing 'phantomjs'binary.
[INFO] Binary 'geckodriver' Exists: true
[INFO] Using existing 'geckodriver'binary.
[INFO] Setting maven property - ${webdriver.chrome.driver} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/googlechrome/64bit/chromedriver
[INFO] Setting maven property - ${webdriver.opera.driver} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/operachromium/64bit/operadriver
[INFO] Setting maven property - ${phantomjs.binary.path} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/phantomjs/64bit/phantomjs
[INFO] Setting maven property - ${webdriver.gecko.driver} = /home/mpkorstanje/das-cucumber/selenium_standalone/linux/marionette/64bit/geckodriver
[INFO]  
[INFO] --------------------------------------------------------
[INFO] SELENIUM STAND-ALONE EXECUTABLE DOWNLOADS COMPLETE
[INFO] --------------------------------------------------------
[INFO]  
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mpkorstanje/das-cucumber/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ das-cucumber ---
[INFO] No sources to compile
[INFO] 
[INFO] --- cucumber-jvm-parallel-plugin:2.1.0:generateRunners (generate-runners) @ das-cucumber ---
[INFO] Adding /home/mpkorstanje/das-cucumber/target/generated-test-sources/cucumber to test-compile source root
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ das-cucumber ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ das-cucumber ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 29 source files to /home/mpkorstanje/das-cucumber/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ das-cucumber ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ das-cucumber ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/mpkorstanje/das-cucumber/target/das-cucumber-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test (default) @ das-cucumber ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Update the repository map

Please, can you update the repository map so we can remove the dependency to update the custom repository map.

Thanks!

cannot download osx driver

Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.7:selenium (default) on project org.bigtester.ate.core: Execution default of goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.7:selenium failed: Unrecognised operating system name 'osx' -> [Help 1]

selenium-standalone-server-plugin + surefire plugin

Hi,

I've got a question.
Is it possible to use maven-surefire-plugin with driver-binary-downloader-maven-plugin?

In the examples here it is used with maven-failsafe-plugin only. And when command

$ mvn clean verify

is run, failsafe plugin has already got right system variables for drivers, i.e. webdriver.chrome.driver.

But if surefire plugin is used, and the command

$ mvn clean test

is run, the system variables for webdriver are still unknown, and one has to run the command

$ mvn clean webdriver-binary-downloader:selenium test

Thanks,
Roma

operatingSystems.linux = false, still downloads linux drivers

I am using version 1.0.0. I have:
<operatingSystems>
<windows>true</windows>
<linux>false</linux>
<osx>false</osx>
</operatingSystems>
Just tried this on my Linux machine, and it downloads the Linux binaries!?!?

Further, it errors with: ".bz2 is an unsupported archive type"

Am I doing this wrong?

Setting the maven properties does not persist to the application layer.

I may be doing this wrong or have the wrong expectations... but here is the problem.

when I run the below maven configuration I do not get expected results.
Inside my project I have a class:

public class Main{

    public static void main(String[] args){
        System.out.prinln(System.getEnv("webdriver.chrome.driver"));
    }

}

when I run the command
mvn clean install exec:java

id expect the output to show the path to the webdriver, however I get null.

Thank you for any input.

plugin definintion:

        <plugin>
            <groupId>com.lazerycode.selenium</groupId>
            <artifactId>driver-binary-downloader-maven-plugin</artifactId>
            <version>1.0.8</version>
            <configuration>
                <rootStandaloneServerDirectory>tmp/binaries</rootStandaloneServerDirectory>
                <downloadedZipFileDirectory>tmp/zips</downloadedZipFileDirectory>
                <customRepositoryMap>RepositoryMap.xml</customRepositoryMap>
                <operatingSystems>
                    <mac>true</mac>
                </operatingSystems>
                <thirtyTwoBitBinaries>true</thirtyTwoBitBinaries>
                <sixtyFourBitBinaries>true</sixtyFourBitBinaries>
                <onlyGetLatestVersions>true</onlyGetLatestVersions>
                <fileDownloadRetryAttempts>2</fileDownloadRetryAttempts>
                <fileDownloadConnectTimeout>20000</fileDownloadConnectTimeout>
                <fileDownloadReadTimeout>10000</fileDownloadReadTimeout>
                <overwriteFilesThatExist>false</overwriteFilesThatExist>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>selenium</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <configuration>
                <mainClass>com.clinktest.Main</mainClass>
            </configuration>
        </plugin>

file hash doesn't coincide with expected while downloading artifact via https

Hi all,

While I'm trying to download an artifact from local repository via https I get the following error:
[ERROR] File : 'chromedriver_linux64.zip'.
[ERROR] Expected file hash : '025a098cde0a6ad8aef53d6734979c9845bf49b5'.
[ERROR] Actual file hash : 'fe1f6c9fb1e46f147c2ba08322f182bedc3d4103'.
[INFO] Archive file 'chromedriver_linux64.zip' is valid : false
[INFO] Problem downloading 'chromedriver_linux64.zip'...
whereas downloading this zip via http is always successful.

I tried to find similar issues related to the plugin but failed what's more in the example of the repository mapping file there is https defined. So I may conclude that it should work.
Could you please help me to figure out what could be wrong and how I can try to solve an issue?

Thank you very much indeed,
Alex

Zip files not being explicitly closed

Archives are not being explicitly closed after extracting files from them. This results in some extra log spam which isn't really needed and some auto clean up that shouldn't be relied upon.

Failed to download all of the standalone executables: Stream is not in the BZip2 format

I use version 1.0.10 of plugin

sometimes, I have this bug:
[ERROR] Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.10:selenium (default) on project rapid: Failed to download all of the standalone executables: Stream is not in the BZip2 format -> [Help 1]

[INFO] Preparing to download Selenium Standalone Executable Binaries...
[INFO] Using http proxy: renn.proxy.corp.xxxxx:8080
[INFO] Downloading 'phantomjs-2.1.1-linux-i686.tar.bz2'...
[INFO] Archive file 'phantomjs-2.1.1-linux-i686.tar.bz2' is valid : true
[INFO] Binary 'phantomjs' Exists: true
[INFO] Using existing 'phantomjs'binary.
[INFO] Using http proxy: renn.proxy.corp.xxxxx:8080
[INFO] Downloading 'chromedriver_linux64.zip'...
[INFO] Archive file 'chromedriver_linux64.zip' is valid : true
[INFO] Binary 'chromedriver' Exists: true
[INFO] Using existing 'chromedriver'binary.
[INFO] Using http proxy: renn.proxy.corp.xxxxx:8080
[INFO] Downloading 'chromedriver_linux32.zip'...
[INFO] Archive file 'chromedriver_linux32.zip' is valid : true
[INFO] Binary 'chromedriver' Exists: true
[INFO] Using existing 'chromedriver'binary.
[INFO] Using http proxy: renn.proxy.corp.xxxxx:8080
[INFO] Downloading 'phantomjs-2.1.1-linux-x86_64.tar.bz2'...
[INFO] Archive file 'phantomjs-2.1.1-linux-x86_64.tar.bz2' is valid : true
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Notifying upstream projects of job completion
Join notifier requires a CauseAction

My target is phantomjs-2.1.1 on linux 64 bits. this file is downloaded in downloadedZipFileDirectory directory but after I have the problem when unzip in rootStandaloneServerDirectory/linux/phantomjs/64bit directory

The plugin code is in selenium-standalone-server-plugin/src/main/java/com/lazerycode/selenium/SeleniumServerMojo.java

try {
DownloadHandler standaloneExecutableDownloader = new DownloadHandler(
this.rootStandaloneServerDirectory,
this.downloadedZipFileDirectory,
this.fileDownloadRetryAttempts,
this.fileDownloadConnectTimeout,
this.fileDownloadReadTimeout,
buildDownloadableFileRepository(parser.getAllNodesInScope(), thirtyTwoBitBinaries, sixtyFourBitBinaries),
this.overwriteFilesThatExist,
this.checkFileHashes,
this.useSystemProxy,
this.onlyGetLatestVersions);
driverRepository = standaloneExecutableDownloader.ensureStandaloneExecutableFilesExist();
} catch (IOException e) {
throw new MojoExecutionException("Failed to download all of the standalone executables: " + e.getLocalizedMessage());
}

Extra binaries downloaded sometimes

If a specific version does not contain a binary for every os specified we drop back to the previous version searching for valid binaries for the missing os. When this happens it will download binaries for the old version as well as binaries for the current version.

Not a huge problem, worst case scenario you get an extra binary. This only happens if binaries for different operating systems are at different versions (as the googlechrome one currently is).

Error because of *.tar.bz2 Phantom packages.

Hi,

PhantomJS has *.tar.bz2 packages for Linux, in example: https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2

but in plugin source I see that you suppose there should be *.tar.gz packages:
ExtractFilesFromArchive.java:

else if(fileType.equals("gz")){
            LOG.debug("Extracting binary from .tar.gz file");
            return untarFile(downloadedZip, extractedToFilePath, overwriteFilesThatExist, possibleFilenames);
        }

and GzipCompressorInputStream is used.

Could you change plugin's code to accept *.tar.bz2 packages?
I've checked and only two cosmetics things needs to be changed:

  • changes in extractFileFromArchive method:
else if(fileType.equals("bz2")){
            LOG.debug("Extracting binary from .tar.bz2 file");
            return untarFile(downloadedZip, extractedToFilePath, overwriteFilesThatExist, possibleFilenames);
        }
  • and changing GzipCompressorInputStream to BZip2CompressorInputStream in untarFile method

BR,
Tomasz

Add support for Firefox esr binaries

My selenium project currently will not work with marionette driver. Instead I have downloaded the exe for Firefox Extended Support Release version and I have the path to the binary hard coded and I create the firefox driver like this:

FirefoxBinary binary = new FirefoxBinary(pathToBinary);
instance  = new FirefoxDriver(binary, profile);

Is there a way to use this plugin for the esr binary?

Support for (standalone) browser download

There's currently possibility to download only PhantomJS as complete browser. There're portable packages of Firefox and Google Chrome available, which could be used same way as PhantomJS in testing and same time be sure that there's no version incompatibility with Selenium.

New drivers could be at least:

  • firefox (environment property pointing to firefox binary: webdriver.firefox.bin)
  • googlechrome

Unexpected delay when downloading/extracting drivers for all platforms

Version 1.0.4

Given the configuration:

<plugin>
                <groupId>com.lazerycode.selenium</groupId>
                <artifactId>driver-binary-downloader-maven-plugin</artifactId>
                <version>1.0.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>selenium</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <customRepositoryMap>repository-map.xml</customRepositoryMap>
                    <onlyGetDriversForHostOperatingSystem>false</onlyGetDriversForHostOperatingSystem>
                    <operatingSystems>
                        <windows>true</windows>
                        <linux>true</linux>
                        <osx>true</osx>
                    </operatingSystems>
                    <rootStandaloneServerDirectory>${basedir}/selenium-driver/</rootStandaloneServerDirectory>
                    <onlyGetLatestVersions>true</onlyGetLatestVersions>
                    <thirtyTwoBitBinaries>false</thirtyTwoBitBinaries>
                    <sixtyFourBitBinaries>true</sixtyFourBitBinaries>
                    <throwExceptionIfSpecifiedVersionIsNotFound>true</throwExceptionIfSpecifiedVersionIsNotFound>
                </configuration>
            </plugin>

I get this output:

--------------------------------------------------------
 DOWNLOADING SELENIUM STAND-ALONE EXECUTABLE BINARIES...
--------------------------------------------------------

 file:/C:/Users/Gili/Documents/realestate/importer/repository-map.xml is valid

Only get drivers for current Operating System: false
Download 32bit binaries: false
Download 64bit binaries: true
Download Latest Versions Only: true
Throw Exception If Specified Version Is Not Found: true

Archives will be downloaded to 'C:\Users\Gili\Documents\realestate\importer\selenium_standalone_zips'
Standalone executable files will be extracted to 'C:\Users\Gili\Documents\realestate\importer\selenium-driver'

Preparing to download Selenium Standalone Executable Binaries...

Archive file 'phantomjs-1.9.7-macosx.zip' exists   : true
Archive file 'phantomjs-1.9.7-macosx.zip' is valid : true
Binary 'phantomjs' Exists: true

Archive file 'chromedriver_linux64.zip' exists   : true
Archive file 'chromedriver_linux64.zip' is valid : true
Binary 'chromedriver' Exists: true

Archive file 'phantomjs-1.9.7-windows.zip' exists   : true
Archive file 'phantomjs-1.9.7-windows.zip' is valid : true
Binary 'phantomjs.exe' Exists: true

Archive file 'chromedriver_mac32.zip' exists   : true
Archive file 'chromedriver_mac32.zip' is valid : true
Binary 'chromedriver' Exists: true

Archive file 'chromedriver_win32.zip' exists   : true
Archive file 'chromedriver_win32.zip' is valid : true
Binary 'chromedriver.exe' Exists: true

Archive file 'phantomjs-1.9.7-linux-x86_64.tar.bz2' exists   : true
Archive file 'phantomjs-1.9.7-linux-x86_64.tar.bz2' is valid : true
Binary 'phantomjs' Exists: true

--------------------------------------------------------
SELENIUM STAND-ALONE EXECUTABLE DOWNLOADS COMPLETE
--------------------------------------------------------

However, there is a 16 second delay between when Binary 'phantomjs' Exists: true and SELENIUM STAND-ALONE EXECUTABLE DOWNLOADS COMPLETE are printed.

This delay occurs even if all drivers have already been downloaded and extracted (meaning, if you run this plugin twice in a row the second time runs just as slow as the first even though the output files do not need to be changed).

Please investigate where this 16 second delay is coming from, and try to avoid doing any work if the output files will not be changed (meaning, the source versions did not change and the output files already exist).

Proxy support

Hello,

Does the plugin support fetching the WebDriver when behind a proxy? On my local enivornment with appropriate proxy settings in settings.xml as well as shell http_proxy and https_proxy env variables set, it fails.

hashes for IEDriverServer in RepositoryMap.xml are wrong

In version 1.0.2, the md5 hashes in the RepositoryMap.xml are wrong, and so the build fails with:
[INFO] Problem downloading 'IEDriverServer_x64_2.41.0.zip'... null
[ERROR] Unable to successfully downloaded 'IEDriverServer_x64_2.41.0.zip'!

Track currently used version of driver

We aren't tracking the currently used version of the driver anywhere which means that we don't overwrite the binary of a new one has been downloaded.

Solution is probably going to be store a version number, or a hash of the extracted file/files somewhere so we know that we need to update.

com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.1:selenium failed. NullPointerException

Running with version 1.0.1 (verified on Windows and Linux), produces NullPointerException.

My pom is exactly as your "Basic Usage" at http://ardesco.lazerycode.com/index.php/2012/08/introducing-the-driver-binary-downloader-maven-plugin-for-selenium/

Full stacktrace is:

Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.1:selenium (default) on project groovy: Execution default of goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.1:selenium failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.1:selenium (default) on project groovy: Execution default of goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.1:selenium failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.lazerycode.selenium:driver-binary-downloader-maven-plugin:1.0.1:selenium failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.lang.NullPointerException
    at javax.xml.transform.stream.StreamSource.<init>(StreamSource.java:147)
    at com.lazerycode.selenium.SeleniumServerMojo.checkRepositoryMapIsValid(SeleniumServerMojo.java:295)
    at com.lazerycode.selenium.SeleniumServerMojo.execute(SeleniumServerMojo.java:183)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more

Not explicitly making the binary executable

The zip files are downloaded successfully and the files are all extracted, however the individual executable binaries are not explicitly make executable. This will probably cause problems on *nix based system where file are not executable by default.

Hashes are required, even if setting is disabled

Unless I'm misunderstanding how things work, I have the following setting in place:

 <checkFileHashes>false</checkFileHashes>

This is in the configuration area. However, even with this in place, I still get the following error if I don't have hashes:

Failed to execute goal com.lazerycode.selenium:driver-binary-downloader-
maven-plugin:1.0.7:selenium (default) on project lucid: RepositoryMap.xml is
not valid: cvc-complex-type.2.4.b: The content of element 'bitrate' is not
complete. One of '{hash}' is expected.

The reason I'm trying to run without the hashes is that it's not clear to me where to get them. For example, I have the following in place:

<filelocation>http://chromedriver.storage.googleapis.com/2.19/chromedriver_mac32.zip</filelocation>

When I look at the download location (http://chromedriver.storage.googleapis.com/), I don't see a hash. I see an etag, but that's about it. The etag is this:

259bb87f4ebf3b0bc4792ed203bd69f5

But the hash that is expected is:

64ef44893a87a0e470b60ff8f5fc83a588b78023

Keep the map.xml up to date

Hi Ardesco,

This is not really a bug but more of a question.
At the moment the map.xml file needs to be maintained manually.
I was wondering if there is a way to automatically find out whether a new version of the driver is posted and update the version number and hash automatically.

Also, would you please let me know how you found the hash number for the drivers? I could only see the Etag values from the download page but not the hash values. http://chromedriver.storage.googleapis.com/index.html?path=2.8/

Thanks for developing this library and attention to my question! ๐Ÿ˜„

Regards,

Sherry

Add googlechrome driver 2.27 for osx

Content for RepositoryMap.xml

        <driver id="googlechrome">
            <version id="2.27">
                <bitrate thirtytwobit="false" sixtyfourbit="true">
                    <filelocation>https://chromedriver.storage.googleapis.com/2.27/chromedriver_mac64.zip</filelocation>
                    <hash>3ebf455e5f461c8f7cabb825af40205b53fce58b</hash>
                    <hashtype>sha1</hashtype>
                </bitrate>
            </version>
        </driver>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.