Barodapride
Barodapride

Reputation: 3723

Running a Dockerized Selenium Grid on Jenkins

I'm trying to get my tests running in Jenkins. I have Dockerized my test runner code, and am using the Dockerized Selenium hub/grid. I can run everything fine locally on my machine and would like to do the same on a Jenkins server. All the containers are started using the docker shell commands, and they are all put on the same Docker network so they can communicate. Again, everything works fine locally, but when I try this on the Jenkins machine I get an error message saying:

Error forwarding the new session cannot find : Capabilities [{rotatable=false, ...

Since the exact same commands work locally the only reason I can think of why this fails is because the containers must be unable to communicate on the Jenkins machine. Perhaps they are started on another node or slave, I'm not sure. Does anyone have experience running multiple containers on a Jenkins machine? Or does anyone have any other ideas of why this is failing?

Upvotes: 4

Views: 1931

Answers (2)

Terefe
Terefe

Reputation: 309

if you are using Jenkins Container Have Jenkins connect to the Selenium-Hub container's internal IP directly,Not through local host or FQDN,

Upvotes: 1

Barodapride
Barodapride

Reputation: 3723

This error was being caused by a shared volume that was hanging around between runs. The containers were the same, but the shared volume's data was old and not correct, thus the difference when running in the Jenkins environment. Moral of the story is make sure everything is cleaned up between Docker runs. Not just containers, volumes and perhaps networks too.

Upvotes: 1

Related Questions