This is a simple plugin for Gradle to keep your Chromedriver for Selenium up to date. It checks the google code website for a new version of the Chromedriver, and downloads it to the build directory.
The plugin has been successfully tested with Gradle 4.10.3 on Mac OS (including M1) and Windows 10. It should work with newer versions and on other operations systems as well.
Put these in your build.gradle
(Gradle 4.10.3 or higher):
plugins {
id "eu.leontebbens.gradle.chromedriver-updater" version "1.8.0"
}
apply plugin: "eu.leontebbens.gradle.chromedriver-updater"
Next run gradlew updateChromedriver
and the drivers will be downloaded to the directory build
.
Plugin allows you to download the latest chromedriver version according to the latest version selection. To configure the major chromedriver version, add these lines to your build script file:
chromedriver {
majorVersion = "78"
}
To use the downloaded driver in your tests:
task integrationTest(type: Test, dependsOn: updateChromedriver) {
systemProperties = [
'webdriver.chrome.driver' : "${updateChromedriver.driverLocation}"
]
// your testing code here ...
}
And run gradlew updateChromedriver integrationTest
to use the downloaded driver in you Integration Tests.
More about the property webdriver.chrome.driver
here.
When you are behind a proxy, use the http.proxyHost and http.proxyPort JVM parameters
gradlew myTask -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=8080
Run gradlew checkChromedriver
if you only want to check for a new Chromedriver version. No driver files are downloaded.
This can be used in a daily job in Jenkins to inform people by e-mail of a new Chromedriver versions.
Therefore the gradle build will FAIL when a new Chromedriver version is available.
The plugin is licensed under the Apache License, Version 2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Raise an issue on Github or Tweet me. Suggestions are welcome too!
Léon Tebbens