# Install ChromeDriver and execute Robot Selenium tests in the Azure DevOps

**URL:** <https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404>\
**Category:** SeleniumLibrary\
**Created:** [28 October 2023 22:14 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404 "2023-10-28T22:14:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![KPrasad](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KPrasad](https://forum.robotframework.org/u/KPrasad)\
**Post date:** [28 October 2023 22:14 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/1 "2023-10-28T22:14:03Z")

</div>

Hi,  
I am working on UI automation using the Robot Framework Selenium library. Currently, the code is in my local repository, but I would like to create a test pipeline(Azure Devops). However, I am facing the following challenges:

1. How can I set up the ChromeDriver path when ‘executable\_path’ is not supported by WebDriver?
2. Do I need to install chrome while executing in headless mode

Would be great if you could help me with an example/best practices to be followed.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [28 October 2023 22:59 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/2 "2023-10-28T22:59:34Z")

</div>

Hi KP,

This issue ([Error downloading Chromedriver above 114 version · Issue #99 · MarketSquare/webdrivermanager · GitHub](https://github.com/MarketSquare/webdrivermanager/issues/99)) has been an issue for many people here.

In looking for a workaround I think I’ve found one.

## _ **This is not tested yet** _

There is another python module for updating selenium drivers it’s called `webdriver-manager` not `webdrivermanager`, yeah the names are confusingly similar

`webdriver-manager` doesn’t have a commandline interface

however if we install it with `pip install webdriver-manager`

Then add the following line before any SeleniumLibrary keywords

```python
${driverpath}= Evaluate webdriver_manager.chrome.ChromeDriverManager().install() modules=webdriver_manager.chrome

```

I think this will work, not sure if we also need to update the path variable?

I’ll do some further tests later today, don’t have time right now, but hopefully this will help.

Dave.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [29 October 2023 04:33 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/3 "2023-10-29T04:33:18Z")

</div>

Hi KP,

FYI I got a chance to confirm this works:

```python
	${driverpath}= Evaluate webdriver_manager.chrome.ChromeDriverManager().install() modules=webdriver_manager.chrome
	Open Browser http://www.duck.com Chrome executable_path=${driverpath}

```

Dave.

---

<div class="post-metadata">

**Author:** ![KPrasad](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KPrasad](https://forum.robotframework.org/u/KPrasad)\
**Post date:** [29 October 2023 07:11 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/4 "2023-10-29T07:11:36Z")

</div>

Thank you, Damies, for the quick response. It seems to have solved most of my problem. However, I get the following error when I execute scripts in the Azure DevOps pipeline.

SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.  
(session not created: DevToolsActivePort file doesn’t exist)  
(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [29 October 2023 07:43 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/5 "2023-10-29T07:43:32Z")

</div>

Hi KP,

Does your test pipeline machine have a GUI?

For example If it’s a linux machine it needs the DISPLAY variable set in the OS, for that you will need a Display (X11 or Wayland), if it’s a VM or Docker container with no graphics card, then use XVFB.

Chrome (and most other browsers) won’t run without a GUI even when running headless.

Dave.

---

<div class="post-metadata">

**Author:** ![KPrasad](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KPrasad](https://forum.robotframework.org/u/KPrasad)\
**Post date:** [29 October 2023 08:45 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/6 "2023-10-29T08:45:11Z")

</div>

I am executing it in an Azure VM, and I don’t think it has a UI. So, I assume I have to use XVFB. Please let me know if you have any references or snippets.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [29 October 2023 12:08 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/7 "2023-10-29T12:08:11Z")

</div>

Hi KP,

Sorry I’m not familiar with Azure VM’s, from the website there appears to be Windows and Linux VM’s but it doesn’t say which Linux distro so I won’t be able to give you exact instructions.

As an overview if you’re using Linux you’ll need to:

- install XVFB with your package manager (On Debian based distro’s use `apt install xvfb`
- configure XVFB’s display number and run XVFB
- Set the operating system variable `$DISPLAY` for the XVFB display number
- run your robot test as the user where you configured the `$DISPLAY` variable

Windows VM’s already should have a GUI so if you’re using a Windows VM you have a different issue.

Hope that helps,

Dave.

---

<div class="post-metadata">

**Author:** ![KPrasad](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KPrasad](https://forum.robotframework.org/u/KPrasad)\
**Post date:** [29 October 2023 18:29 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/8 "2023-10-29T18:29:44Z")

</div>

Thank you Dave. Really appreciate your help.

Below is how I solved it as you suggested

export DISPLAY=:99  
Xvfb $DISPLAY -ac -screen 0 1024x768x16  
xvfb-run --server-args=“-screen 0, 1024x768x16” robot Test

---

<div class="post-metadata">

**Author:** ![KPrasad](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KPrasad](https://forum.robotframework.org/u/KPrasad)\
**Post date:** [9 November 2023 10:37 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/9 "2023-11-09T10:37:14Z")

</div>

I am not sure if I need to create a new thread for this query. I am getting below error when trying to execute same in GitLab.  
++ inside Docker

I am using xvfb-run command to execute robotframework tests  
Suite setup failed:  
(session not created: DevToolsActivePort file doesn’t exist)  
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [10 November 2023 02:14 UTC](https://forum.robotframework.org/t/install-chromedriver-and-execute-robot-selenium-tests-in-the-azure-devops/6404/10 "2023-11-10T02:14:42Z")

</div>

Hi KP,

I’m not sure, I never used xvfb-run, I just ran xvfb as a background process before running robot and that’s what worked for me.

I had the pip installs between starting xvfb and running robot and that maybe gave xvfb enough time to startup and be ready for applications, and maybe using xvfb-run is not, but I’m just guessing here.

Dave.
