Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to execute chromedriver using bitbucket pipeline

Jyothi Penumudi August 12, 2020

I am working on a windows machine and pushing my selenium scripts to bitbucket from eclipse. When bitbucket pipelines exeuctes my test scenarios, I am getting below error message: 

error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directoryAug 12, 2020 10:06:32 PM org.openqa.selenium.os.OsProcess checkForErrorSEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127)

This is my chromedriver Linux path:

/opt/atlassian/pipelines/agent/build/drivers/chromedriverLinux:

Here chromedriverLinux is compatible with Linux OS. 

This is my bitbucket-pipelines.yml file

image: maven:3.6.1

pipelines:
default:
- step:
caches:
- mvn
services:
- selenium-standalone
script:
- chmod 777 /opt/atlassian/pipelines/agent/build/drivers/chromedriverLinux
- mvn test
definitions:
caches:
mvn: $HOME/.mvn
services:
selenium-standalone:
image: selenium/standalone-chrome:latest

Please help me how to resolve this issue...

2 answers

0 votes
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2020

You see the error because you've committed the chrome driver into the repository and it is incomplete. Even it is for Linux, it is a binary that requires additional shared libraries, here libglib-2.0.so.0. These are not available within the maven build container.

To benefit from Bitbucket Pipelines, the chromedriver should not be put into the repository to have it available in the build container. The reason is that this is hard to manage.

Instead remove the chrome driver from the project repository and remove the chmod line.

Then I'd suggest that you create your own build container image based on the image in your pipeline (maven:3.6.1) with a Dockerfile (which is fine to commit into the repository).

You can build and test it locally first, including running the build service. This is outlined in Debug pipelines locally with Docker and supported as well by my Bitbucket Pipelines runner utility named "pipelines".

Alternatively if you'd like to do the vendoring of the chrome-driver, a static binary might already work, too. I don't know if one exists and I also would not recommend it anyway as the benefit of build containers is to not have the build dependencies within the project repository.

0 votes
arjun kapur August 17, 2020

I am stuck on this same Issue. Were you able to figure this out yet

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events