Open Browser Shows SessionNotCreatedException

When I run Open Browser locally on my mac machine, everything works smoothly. When I launch the same command remotely via Jenkins job on my remote mac machine, I get following error:

Setup failed:
SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
(chrome not reachable)
(The process started from chrome location /Users/jenkins/.cache/selenium/chrome/mac-x64/119.0.6045.105/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
0 chromedriver 0x000000010eea2d28 chromedriver + 4795688
1 chromedriver 0x000000010ee9a2b3 chromedriver + 4760243
2 chromedriver 0x000000010ea7388d chromedriver + 407693
3 chromedriver 0x000000010eaaac6e chromedriver + 633966
4 chromedriver 0x000000010eaa728c chromedriver + 619148
5 chromedriver 0x000000010eaf3afb chromedriver + 932603
[ Message content over the limit has been removed. ]
…hromedriver 0x000000010eab531e chromedriver + 676638
9 chromedriver 0x000000010ee63795 chromedriver + 4536213
10 chromedriver 0x000000010ee68853 chromedriver + 4556883
11 chromedriver 0x000000010ee49001 chromedriver + 4427777
12 chromedriver 0x000000010ee6959d chromedriver + 4560285
13 chromedriver 0x000000010ee3a48c chromedriver + 4367500
14 chromedriver 0x000000010ee890e8 chromedriver + 4690152
15 chromedriver 0x000000010ee8929e chromedriver + 4690590
16 chromedriver 0x000000010ee99eee chromedriver + 4759278
17 libsystem_pthread.dylib 0x00007ff816990259 _pthread_start + 12

Need some pointer. Can someone help me here?
Robot 6.1.1
Python 3.9.6 on Darwin
SeleniumLibrary. 6.1.3

Which version of selenium are you using?

The first thing to check is to make sure the chromedriver matches the chrome version. What are those versions as well?

1 Like

Welcome by the way to the Robot Framework Forum Chetan! :robot:

2 Likes

Thanks EdManlove!

I am using SeleniumLibrary. 6.1.3
yes, chromedriver version is not an issue here. I am able to successfully run the test when I launch it locally on the same mac machine. Th eproblem is when I run test from Jenkins on remote mac machine node.

Hi Chetan,

Here’s a couple of troubleshooting ideas to help narrow down what might be the issue

Something that can cause a browser to crash is the lack of a display, this is more commonly a problem on Linux, but I have seen it on MacOS as well in some circumstances.

On the line before Open Browser add this:

Log    %{DISPLAY}

If this is not empty then it’s another issue, if it’s empty then you need to make sure the DISPLAY variable is set before running robot.

Also ar you using headless mode? can you try with non headless browser and check if the browser does actually open?

Dave.

1 Like

Thanks Dave! Let me check this solution.

@damies13 OP said the remote agent is mac, not linux so there wont be DISPLAY.env nor X (or wayland or what ever) involved …

For @TheRoboUser; How are you starting the agent ?

Reason for asking that is that as far as i know, mac has similar security restriction that if the jenkins is launched as “service”, anything jenkins tries to run does not have access to anything related to the UI and thus, launching chromedriver / chrome will always fail.

jenkins is launched as service on remote mac agent. I am checking if I can get that node updated.

As a person who has maintained jenkins setups for multiple firms and projects since it was still called Hudson:

  1. auto login the machine to desktop when machine boots
  2. disable any lock screens or screen savers
  3. always launch agents from ssh session if the agent will do any (ui) test automation.

part 3 is not mandatory for linux agents but one needs to deal with virtual or nested x servers (and the DISPLAY env @damies13 mentioned earlier …

1 Like

Thanks @rasjani !! You were spot on with point number 3. Issue is resolved. Appreciate all the help guys :slight_smile:

1 Like