# Issue trying to run robotframework script on Jenkins

**URL:** <https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503>\
**Category:** Jenkins\
**Created:** [27 March 2023 20:39 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503 "2023-03-27T20:39:21Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![coopernico46](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@coopernico46](https://forum.robotframework.org/u/coopernico46)\
**Post date:** [27 March 2023 20:39 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/1 "2023-03-27T20:39:21Z")

</div>

Recently i’m facing an issue when try to run a task from Jenkins that simply run a .robot file.  
I’ve been searching and trying different options from another colleagues that faced similar issues in StackOverFlow but i can’t achive to run the script correctly.

Please let me show you what i’m doing, my scripts and Jenkins setup so you can understand in a better way my problem.

I have this robot file:

```python
***Settings***
Documentation Basic Test
Library SeleniumLibrary

***Variables***
#${result} /opt/google/chrome/chrome
${Browser} chrome
${options} binary_location = '/opt/google/chrome/chrome'

***Test Cases*** 
Abrir web Pangea
    Open Browser url=https://www.google.com/ browser=${Browser} options=${options}
    Close All Browsers

```

And i’m trying to run it as a Jenkin simple task with this simple build step:

```python
robot --outputdir results --nostatusrc Test/basic_2.robot

```

But every time the Console Out show me the msg:

```python
[Robot_QA_Executions] $ /bin/sh -xe /tmp/jenkins3290544249294601087.sh
+ robot --outputdir results --nostatusrc Test/basic_2.robot
==============================================================================
Basic 2 :: Basic Test                                                         
==============================================================================
Abrir web Pangea | FAIL |
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
  (unknown error: 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.)
------------------------------------------------------------------------------
Basic 2 :: Basic Test | FAIL |
1 test, 0 passed, 1 failed
==============================================================================

```

To be sure of the Chrome path and this kind of things i also create this Python file:

```python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time

# Ruta del controlador de Chrome
webdriver.ChromeOptions.binary_location = '/opt/google/chrome/chrome'

# Opciones para el navegador
ChromeOptions = webdriver.ChromeOptions()
ChromeOptions.add_argument('--headless')

# Crea una instancia del navegador Chrome
driver = webdriver.Chrome(chrome_options=ChromeOptions)

# Navega a la pagina web de Google Espana
driver.get("https://www.google.es")
print("google abierto")
time.sleep(2)
driver.get("https://pangea.es/")
print("pangea abierto")

# Cierra el navegador
time.sleep(10)
driver.quit()
print("fin del test")

```

And after run, also from jenkin task with the build Step:

```python
#!/usr/bin/env python3	./Test/ejemplo_Python_2.py

```

The Python Script works as expected.

Please can you help me to solve this issue? i tried with different optiones like “options”,“binary\_location”, “executable\_path” etc… with no success. ☹

I also double-check that i have installed:

```python
$ /opt/google/chrome/chrome --version
Google Chrome 110.0.5481.177

$ chromedriver --veresion
Starting ChromeDriver 110.0.5481.77 (65ed616c6e8ee3fe0ad64fe83796c020644d42af-refs/branch-heads/5481@{#839}) on port 9515

pip (9.0.3)
Pygments (2.14.0)
robotframework (6.0.2)
robotframework-datadriver (1.6.1)
robotframework-pythonlibcore (3.0.0)
robotframework-seleniumlibrary (6.0.0)
selenium (3.141.0)
setuptools (39.2.0)
urllib3 (1.26.14)

```

I would like to add more details to my issue.  
If i try with

```
Create Webdriver Chrome executable_path=/usr/local/bin/chromedriver 
Go To https://www.google.com

```

instead OpenBrowser. Jenkins return the error msg:

```
WebDriverException: Message: Service /opt/google/chrome/chrome unexpectedly exited. Status code was: 1

```

I expect to be able to run \*.robot files from a Jenkins task (My Jenkins is over a AWS Linux machine) and the repositoty it’s on GitLab.

---

<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 March 2023 05:22 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/2 "2023-03-28T05:22:11Z")

</div>

Hi Pablo,

Here’s the good news, I suspect your issue has nothing to do with Jenkins, and everything to with chrome, chromedriver and seleniumlibrary

> [@coopernico46](#):
>
> ```python
> ------------------------------------------------------------------------------
> Basic 2 :: Basic Test | FAIL |
> 1 test, 0 passed, 1 failed
> ==============================================================================
> 
> ```

This pretty much proves that Jenkins ran robot framework and Jenkins got the correct response from the ran robot framework test (the test failed)

Most commonly when I see this error:

> [@coopernico46](#):
>
> ```python
> WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
> (unknown error: 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.)
> 
> ```

It’s because chrome has auto-updated itself and you haven’t updates the chrome WebDriver, I see you did your best to ensure the versions the same 👍 but you might have been unlucky and [got caught out on release day](https://chromereleases.googleblog.com/)?

> Monday, March 27, 2023  
> The Stable channel has been updated to 111.0.5563.147 for Mac and Linux and 111.0.5563.146/.147 for Windows

If you’re sure that chrome didn’t auto-update itself, you might have been unlucky with your chrome WebDriver version, seems from the [release notes](https://chromedriver.chromium.org/downloads) there were issues with Chromedriver version 110.0.5481.77:

> ChromeDriver 112.0.5615.28  
> Supports Chrome version 112
> 
> - Resolved issue 4357: Chromedriver version 110.0.5481.77 session issue with --headless and --user-data-dir options. [Pri-1]

I’ve also had issues in the past with ChromeDriver being less than Chrome even in the subminor version, in your case you are 77 vs 177, and 77 is the latest version in the 110.0.5481 range so it “should” work but not always

```python
ChromeDriver 110.0.5481.77
Chrome 110.0.5481.177

```

I’ll suggest you try again with chrome/chromedriver 111.0.5563.x before wasting too much time on anything else

I’ve also had that error `error: Chrome failed to start: exited abnormally.` when I had a buggy version of chrome that was actually crashing on launch or when chromedriver crashed on launch (not for a long time though)

Hopefully some of this is helpful,

Dave.

---

<div class="post-metadata">

**Author:** ![coopernico46](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@coopernico46](https://forum.robotframework.org/u/coopernico46)\
**Post date:** [28 March 2023 22:28 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/3 "2023-03-28T22:28:08Z")

</div>

Hi @damies13  
Thanks for your time and for your support. I think that the problem was related mainly with the updates (as you told me). Right know all it’s working for me but i also did some changes in my script in order to be able to run it without issues.  
I’ll let here the code that make my script works but i’m so convinced that updates were also there… (just in case other colleague could have the same issue trying to setup the chrome options)

**First way:**  
\*\*\* Settings \*\*\*  
Documentation test basico  
Library SeleniumLibrary

\*\*\* Variables \*\*\*  
${chrome\_options} add\_argument(“–headless”); add\_argument(“no-sandbox”)

\*\*\* Test Cases \*\*\*  
Abrir web Google  
Open Browser [https://google.es](https://google.es) chrome options=${chrome\_options}

Second way:  
\*\*\* Settings \*\*\*  
Documentation Basic Test  
Library SeleniumLibrary

\*\*\* Variables \*\*\*  
${Browser} chrome  
${driver\_path} /usr/bin/chromedriver  
${chrome\_options} add\_argument(“–headless”); add\_argument(“no-sandbox”)

\*\*\* Test Cases \*\*\*  
Abrir web Google  
Open Browser url=[https://google.es/](https://google.es/) browser=${Browser} options=${chrome\_options} #executable\_path=${driver\_path}

Best regards!

---

<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:** [30 March 2023 00:27 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/4 "2023-03-30T00:27:29Z")

</div>

Hi Pablo,

This is one of the reasons some people use Browser Library instead now. Browser Library seems to prevent the browsers from auto-updating so they can have the right driver for the browser version.

Another option that has worked for me is using installing [webdrivermanager](https://pypi.org/project/webdrivermanager/) and then run `webdrivermanager chrome` before I run robot with my test (or even in a suite startup before opening the browser) this way if chrome auto-updated in the previous test then your webdriver gets updated to the version you need as well.

Dave.

---

<div class="post-metadata">

**Author:** ![coopernico46](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@coopernico46](https://forum.robotframework.org/u/coopernico46)\
**Post date:** [24 April 2023 15:29 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/5 "2023-04-24T15:29:51Z")

</div>

Thanks for the tips @damies13  
Will try the webdrivermanager option so maybe this will help to prevent future issues with chrome driver version missmatch.  
When you talk about " then run `webdrivermanager chrome` before I run robot with my test" you mean that you build a python file and run this file before run .robot scripts? or is there any keyword that i can use?.

Thanks in advance!

---

<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:** [25 April 2023 00:07 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/6 "2023-04-25T00:07:57Z")

</div>

Hi Pablo,

It could be a python file, it doesn’t have to be. [webdrivermanager](https://pypi.org/project/webdrivermanager/) can be run from the command line so it could be a simple shell script (.sh or .bat depending on your OS) or it could be simply a command you add to your [Suite setup](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#toc-entry-439) using [Run](https://robotframework.org/robotframework/latest/libraries/OperatingSystem.html#Run) or [Run Process](https://robotframework.org/robotframework/latest/libraries/Process.html#Run%20Process).

Dave.

---

<div class="post-metadata">

**Author:** ![coopernico46](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@coopernico46](https://forum.robotframework.org/u/coopernico46)\
**Post date:** [25 April 2023 10:01 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/7 "2023-04-25T10:01:41Z")

</div>

Oh! understood.

So you mean something like:

```
***Settings***
Library Process

***Test Cases***
Example Test
    Run Process webdrivermanager chrome

```

or like that if i would like to check if the process goes OK or not:

```
***Settings***
Library Process

***Test Cases***
Example Test
    ${result} Run Process And Log Output webdrivermanager chrome
    Log ${result.stdout}
    Should Not Contain ${result.stderr} ERROR    
    Should Be Equal As Strings ${result.returncode} 0    

```

Or can i even include it as a TestSuite Setup, right?

Best regards

---

<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:** [25 April 2023 10:26 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/8 "2023-04-25T10:26:08Z")

</div>

Hi Pablo,

Yes, I would put it in TestSuite Setup as it’s not really a test of you application but rather something you need to support the test.

Just move `Example Test` as is to keywords and call the keyword as your Test Suite Setup, probably also give it a more meaningful name like `Webdriver Update`

All that will happen most of the time is you get a message that the webdriver is up to date, but occasionally you’ll see it update the webdriver, then you’ll know it saved you.

Dave.

---

<div class="post-metadata">

**Author:** ![vishnuraj123](https://avatars.discourse-cdn.com/v4/letter/v/eada6e/32.png) [@vishnuraj123](https://forum.robotframework.org/u/vishnuraj123)\
**Post date:** [12 May 2023 12:06 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/9 "2023-05-12T12:06:48Z")

</div>

i have robot script including selenium2 library. Running the script on Firefox browser.  
python version is 2.7.18  
geckodriver version 0.30.0  
Mozilla Firefox 112.0.2  
the script worked with same config in one machine. this script fail in another machine with same config with message WebDriverException: Message: Process unexpectedly closed with status 1

---

<div class="post-metadata">

**Author:** ![Rushikesh](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@Rushikesh](https://forum.robotframework.org/u/Rushikesh)\
**Post date:** [26 April 2024 09:33 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/12 "2024-04-26T09:33:30Z")

</div>

And i’m trying to run it as a Jenkin simple task with this simple build step:

```python
robot Demo1.robot

```

But every time the Console Out show me the msg:

```python
C:\Users\Rushi Reddy\Desktop\RobotframeworkMain>robot *.robot 
'robot' is not recognized as an internal or external command,
operable program or batch file.

```

---

<div class="post-metadata">

**Author:** ![coopernico46](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@coopernico46](https://forum.robotframework.org/u/coopernico46)\
**Post date:** [26 April 2024 16:19 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/13 "2024-04-26T16:19:06Z")

</div>

Hi @Rushikesh  
Looks like you have to install robot library in your jenkins machine.

---

<div class="post-metadata">

**Author:** ![Rushikesh](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@Rushikesh](https://forum.robotframework.org/u/Rushikesh)\
**Post date:** [26 April 2024 16:52 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/14 "2024-04-26T16:52:54Z")

</div>

I have isntalled robot framework plugins in jenkins still its showing error can you explain it little more…Please

---

<div class="post-metadata">

**Author:** ![coopernico46](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@coopernico46](https://forum.robotframework.org/u/coopernico46)\
**Post date:** [26 April 2024 19:21 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/15 "2024-04-26T19:21:37Z")

</div>

The error message it’s telling you that Jenkins do not understand the command “robot demo1.robot” so the problem could be related with the robotframework installation.  
Did you install Python and robotframework in your jenkins server? If yes check that it’s in the path so you could use the command.

I’m not a Pro with robot and jenkins, sorry

---

<div class="post-metadata">

**Author:** ![Rushikesh](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@Rushikesh](https://forum.robotframework.org/u/Rushikesh)\
**Post date:** [3 May 2024 19:01 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/16 "2024-05-03T19:01:59Z")

</div>

i ahve installed plugin which is required for robot framework dont know why its showing an error

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [5 May 2024 14:12 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/17 "2024-05-05T14:12:21Z")

</div>

Jenkins RF plugin does not install robot itself into your jenkins environment. It just adds a code into jenkins that lets jenkins read the test report and log files and publish those in format that can be integrated into Jenkins UI.

As @coopernico46 said, you need to install robot and its dependencies separately into each jenkins slave / master node where you intend to run robot.

---

<div class="post-metadata">

**Author:** ![AJ2022](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@AJ2022](https://forum.robotframework.org/u/AJ2022)\
**Post date:** [22 May 2024 05:49 UTC](https://forum.robotframework.org/t/issue-trying-to-run-robotframework-script-on-jenkins/5503/18 "2024-05-22T05:49:03Z")

</div>

Use python -m robot Demo1.robot while Executing Windows batch command
