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 directory
Aug 12, 2020 10:06:32 PM org.openqa.selenium.os.OsProcess checkForError
SEVERE: 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...
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.
I am stuck on this same Issue. Were you able to figure this out yet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.