1

I'm using Maven with Jenkins to manage automated tests in Java and selenium. The development process takes place in MacOS, and the Jenkins server is Windows. When using git to manage the testing code, the "chromedriver" resource is copied between the OS's. This causes a conflict with the windows version needing a .exe vs the macOS file.

How would this best be managed. My ideas are: - ignore the git for the chromedriver files, and manage them on each system individually - track both chromedriver files and specify based on some environment detection which to use

or is there a more elegant strategy? Can jenkins replace files on build time? something like - "take the committed macOS Chromedriver and replace it with this chromedriver.exe and run maven tests" ??

  • https://ardesco.lazerycode.com/testing/webdriver/2012/08/12/introducing-the-driver-binary-downloader-maven-plugin-for-selenium.html – SiKing Jul 17 '19 at 17:04

3 Answers3

0

A possible solution is to install the ChromeDriver plugin onto Jenkins.

Which installs ChromeDriver to every slave within Jenkins, allowing you to git ignore the MacOS and Windows versions on local machines.

ben
  • 1
  • 1
0

I would recommend using isUnix() jenkins pipeline logic. More information is available here or an example is here

Ben W
  • 930
  • 6
  • 16
0

There would be the following solution :

1: [Recommeded] don't manage drivers within the code itself. Set the driver path in the individual machine as environment variables. 2: Use https://github.com/bonigarcia/webdrivermanager and it will automatically install the required driver as per the OS configuration and browser version at the run time.

Tanuj Vishnoi
  • 309
  • 2
  • 8