Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set a PATH for my chromedriver in my bitbucket pipeline

Kunalkumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2020

I am trying to configure my yaml file to enable my tests to be run. Currently it seems that it can read my test files, but it keeps on failing and giving this error WebDriverException: Message: 'chromedriver' executable needs to be in PATH. How do i set a PATH to my chromedriver in Bitbucket?

 

My YAML file:-

image: python:3.7.3
pipelines:

  default:

   - step:

      caches: - pip

  script:

- pip install --upgrade pip

- pip install robotframework robotframework-seleniumlibrary && pip install chromedriver

- robot -d results test_scripts/Tests/Songs.robot

2 answers

0 votes
Yevgen Lasman
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.
October 31, 2020

Something like this would do the job

image: python:3.7.3
pipelines:
default:
- step:
caches: - pip
script:
- pip install --upgrade pip
- pip install robotframework robotframework-seleniumlibrary && pip install chromedriver
- PATH=/path/to/chromedriver/binary:$PATH robot -d results test_scripts/Tests/Songs.robot

The addition is PATH=/path/to/chromedriver/binary:$PATH before calling robot executable. It passes modified PATH environmental variable to this binary execution.

From the other hand, it is strange that pip installs it into the inaccessible location. You may want to check PYPATH passed to robot script too and make sure that the default libraries path is passed.

Kunalkumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 1, 2020

Ok I understand what you mean, but can I point it to the chromedriver in my PC, or do i need to upload the chromedriver to Bitbucket as well?

0 votes
Hana Kučerová
Community Champion
October 31, 2020

Hi @Kunalkumar ,

please look at this article. To be honest, I'm not the Bitbucket Pipelines expert, but it seems to me it could help you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events