I'm trying to run a selenium test on my pipeline but this error shows up:
<span>WebDriverException(</span><span>selenium.common.exceptions.WebDriverException: Message: Service /root/.wdm/drivers/chromedriver/linux64/99.0.4844.51/chromedriver unexpectedly exited. Status code was: 127</span>
<span>WebDriverException(</span>
<span>selenium.common.exceptions.WebDriverException: Message: Service /root/.wdm/drivers/chromedriver/linux64/99.0.4844.51/chromedriver unexpectedly exited. Status code was: 127</span>
This is the pipeline step:
- step: name: Get latest versions of libraries image: python:3.8.2 script: - pip install selenium - pip install beautifulsoup4 - pip install lxml - pip install webdriver-manager - python webscrape.py artifacts: - latest_vers.json
This is the python script:
if __name__ == '__main__': # s = Service("chromedriver.exe") # driver = webdriver.Chrome(service=s) driver = webdriver.Chrome(service=Service(ChromeDriverManager().install())) driver.maximize_window() driver.get("https://www.npmjs.com/") data = get_libraries() latest_ver = scrape(driver, data) output_latest_ver(latest_ver)
Hi @Chong Jing Hong
Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community!
When I was searching about this issue, I found the following site, which mentions, that the selenium test might require additional drivers: https://stackoverflow.com/questions/49323099/webdriverexception-message-service-chromedriver-unexpectedly-exited-status-co
As recommended on this page, can you try to install the following applications?
apt-get install -y libglib2<span style="border: 0px; margin: 0px; padding: 0px;">.0</span>-<span style="border: 0px; margin: 0px; padding: 0px;">0</span>=<span style="border: 0px; margin: 0px; padding: 0px;">2.50</span><span style="border: 0px; margin: 0px; padding: 0px;">.3</span>-<span style="border: 0px; margin: 0px; padding: 0px;">2</span> \ libnss3=<span style="border: 0px; margin: 0px; padding: 0px;">2</span>:<span style="border: 0px; margin: 0px; padding: 0px;">3.26</span><span style="border: 0px; margin: 0px; padding: 0px;">.2</span>-<span style="border: 0px; margin: 0px; padding: 0px;">1.1</span>+deb9u1 \ libgconf-<span style="border: 0px; margin: 0px; padding: 0px;">2</span>-<span style="border: 0px; margin: 0px; padding: 0px;">4</span>=<span style="border: 0px; margin: 0px; padding: 0px;">3.2</span><span style="border: 0px; margin: 0px; padding: 0px;">.6</span>-<span style="border: 0px; margin: 0px; padding: 0px;">4</span>+b1 \ libfontconfig1=<span style="border: 0px; margin: 0px; padding: 0px;">2.11</span><span style="border: 0px; margin: 0px; padding: 0px;">.0</span>-<span style="border: 0px; margin: 0px; padding: 0px;">6.7</span>+b1
and/or
apt-get install -y chromium-browser
Please let us know how it goes.
Best Regards,NorbertAtlassian Bitbucket Cloud Support
hi @Norbert Csupka
I tried both suggestions, and both gave errors
<span>Version '2.50.3-2' for 'libglib2.0-0' was not found<br></span><span>Unable to locate package libnss3<br></span><span>Unable to locate package libgconf-2-4<br></span><span>Unable to locate package libfontconfig1</span>
<span>Version '2.50.3-2' for 'libglib2.0-0' was not found<br></span>
<span>Unable to locate package libnss3<br></span>
<span>Unable to locate package libgconf-2-4<br></span>
<span>Unable to locate package libfontconfig1</span>
<span>Unable to locate package chromium-browser</span>
<span>E: Version '2.50.3-2' for 'libglib2.0-0' was not found</span>
<span>E: Unable to locate package libnss3</span>
<span>E: Unable to locate package libgconf-2-4</span>
<span>E: Unable to locate package libfontconfig1</span>
Hi @Chong Jing Hong ,
Thank you for your reply. It seems that those versions are not available within the build.
Can I ask you to try to install these packages without providing the version numbers? The command for that is:
apt-get install -y libglib2.0 libnss3 libgconf-2-4 libfontconfig1
Please let me know how it goes.
It looks like you're new here. Sign in or register to get started.