TestProject Forum

Execute Docker Image against test project agent

How to execute a Docker Image against test project agent

Have converted my open sdk project code into a docker image, which accepts the following environmental parameters:

  1. browser name
  2. agent url

my agent is installed in my local machine and accessible at: http://localhost:8585, but when I pass this as an environmental parameter to my docker image ( obviously it throws error saying cannot connect to agent), because cannot access localhost from within a container

So we need to provide machine IP instead of localhost, but at http://machineIP:8585 test project agent is not accessible

How to overcome this issue, this is highly important if we are deploying our docker image within Docker Swam or Kubernetes

Hello @vinothone2one
Like we discussed, since the agent is running on your localhost, it won’t be able to be reached outside the localhost network.

To be able to run your tests on remote servers from a different machine, you need to connect to a VPN to be on the same network as the remote machines, and then use a reverse proxy to EXPOSE localhost outside, so you will be able to from machine A to reach the localhost of machine B and execute tests there.

https://ngrok.com/ offers a reverse proxy and they have a free version you can try.

Can you help me to set it up??? As we discussed previously