Use Remote browser in Docker Image (Selenium Grid)

Hi guys,

I need help, please…

I’m launching my test collection from a docker image inside Jenkins, and I’d like to use a remote browser instead of docker’s one. To do this, I tried with these lines on my config file :

-browserType="Remote" \
-remoteWebDriverType="Selenium" \
-remoteWebDriverUrl="http://my.selenium.url" \

But I get a

[TEST_CASE][FAILED] - Test Cases/xxx/xxx/xxx: FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: ''

Caused by: com.kms.katalon.core.exception.StepFailedException: No driver is set for execution.

If I launch my tests on Katalon Studio by using “Remote” as browser, tests pass like a charm…

So the question is : how can I connect to my selenium grid from a docker ?

Many thanks in advance (and sorry in advance too, cause I’m not a dev…)

Nico

Hi,

Is this what you wonder: Selenium Grid - Execution on Remote Machines with Katalon Studio | Katalon Docs?

Hi @Elly_Tran,
well, not exactly. I am able to use remote browser from KS.
The idea is to use the same but inside a docker image launched on a Jenkins server…

Hey @simon.klotz , sorry to bother you, but apparently you’ve been able to solve a similar problem here : How to run tests on remote chrome docker container - #2 by simon.klotz

Could you help me understand how to run tests from docker on a remote browser ? Thanks.

1 Like

Oh I just tried a similar scenario yesterday.
But with 2 docker containers running on my local machine and not on a jenkins.
(I want it to get triggered later via GitLab)

I was trying to run the KRE in one container and the remote browser in a second container.

So if I launch my tests on the first container and try to reach the remote browser inside a second container I need the IP address from the second container.

docker inspect <container_id> |grep IPAddress

Then setup the Remote server URL with the IP you got:

http://172.17.0.2:4444/wd/hub

If the container will have a new IP in future, this is probably not a stable solution … but I’m also about to try this out at the moment.

Hope this is what you needed,
Simon

1 Like

Thanks @simon.klotz , I’m now able to launch tests from a docker mounted on jenkins to a remote browser.

Now the problem is : how do I get download files folder ?

For a standard browser I can get it with :

String userHome = System.getenv( 'userprofile' );
    String downloadPath = userHome + File.separator + "Downloads"

But of course on selenium grid the System.getenv( ‘userprofile’ ) is null.

So now I’m a bit lost…

Solved by using a fixed path :

file:///home/seluser/Downloads