Issue connection Selenoid GGR (Go Grid Router) - selenoid

I am trying to run nightwatchjs test using selenoid ggr (Go Grid router) but I am getting the below error:
- Connecting to un:pwd#ip_add on port 4444...
POST http://un:pwd#ip_add:4444 /wd/hub/session - EAI_FAIL
Error: getaddrinfo EAI_FAIL un:pwd#ip_add
‼ Error connecting to un:pwd#ip_add on port 4444.
Below are the various container that's running on my Linux machine (IP_add)
Could you please support in identifying the issue?
Also, I am unable to navigate to ggr-ui

I was now able to run the test using GGR.
Following command were run to start selenoid, ggr, ggr-ui and selenoid UI:
./cm selenoid start --vnc --port 4445
docker run -d --name ggr -v /etc/grid-router/:/etc/grid-router:ro --net host aerokube/ggr:latest-release
docker run -d --name ggr-ui -p 8888:8888 -v /etc/grid-router/quota/:/etc/grid-router/quota:ro aerokube/ggr-ui:latest-release
docker run -d --name selenoid-ui --link ggr-ui -p 8080:8080 aerokube/selenoid-ui --selenoid-uri=http://ggr-ui:8888
To navigate to ggr dashboard:
http://'ip address':8080/
In nightwatch config use following selenoum config:
host: '192.168.5.241',
port: 4444,
'username': "test",
'access_key': "test-password",
start_process: false,
This way I was able to run the test

Well, to run tests on GGR for me was enough official documentations
https://aerokube.com/ggr/latest/
I configured 2 machines
On machine №1 (where was configure ggr + ggr(ui))
You can see my list of configured containers
list of containers screen
On machine №2
Was configured Selenoid and Selenoid UI
Also do not forget to configure quota file(see official documentation)
See common screen of configuration:
screen of common configuration

Related

Redis with wsl2 podman - connection refused

I'm running Ubuntu 20.04 within WSL2 on Windows 10.
I installed podman.
>podman -v
podman version 3.
I tried starting a container with
podman run --name some-redis -d -p 6379:6379 redis
The container is starting. No errors in the log.
If I tried
redis-cli
From Ubuntu it's working.
From dos/powershell it is not working
rdcli -h localhost
localhost:6379> (error) Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
And also it is not working with my SpringBoot application.
I'm also using a portainer container with port mapping 9000:9000 and I can access it from ubuntu, dos, powershell.
So what's the problem with redis. Is it coming from redis or from wsl2/podman ?
What can I do.
ps : The same container on the same machine with docker desktop was working fine.
You probably run into this WSL2 issue: https://github.com/microsoft/WSL/issues/4851
Solution:
option 1: use [::1]:6379 instead of localhost:6379 from Windows side
option 2: use -p 127.0.0.1:6379:6379 instead of -p 6379:6379 with podman run.

How to point RemoteWebDriver to one of the multiple standalone docker selenium standalone chrome browsers?

I've requirement to run test cases on separate chrome browsers running inside docker container.
I've install chrome docker containers as below
docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium
docker run -d -p 4444:4444 -p 5901:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium
I have scripts which does unique tasks like analytics testing, performance testing etc so I can't use Grid approach here.
This is what I do in case of single chrome browser but I need to point to a particular docker container image
WebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/wd/hub"),
DesiredCapabilities.firefox());
Got it working with help of comment from #Flore B.
docker run -d -p 5902:4444 -p 5903:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.8.1-francium
RemoteWebDriver url
http://0.0.0.0:5902/wd/hub

how to create a selenium/standalone-chrome image with changeable port (the 4444)

I'm was wondering how can I pass a different port number as argument when I'm running the selenium container instead of the default port(4444)
Usually I'm using:
docker run --shm-size=2G -d --net=host -e TZ=UTC -e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 selenium/standalone-chrome:3.7.0
Is it possible to do so with the current selenium image or do I need to build a selenium image of my own and if so how to create that kind of image?
You can bind port with -p
docker run -d -p 4444:4444 --name selenium-hub selenium/hub:3.8.1-aluminum
But if you want change the port inside container I think you must modify sources of image.
Not sure if this works with your docker image, it might help if you try to build your own image.
Use this image from GitHub
https://github.com/SeleniumHQ/docker-selenium/tree/master/StandaloneChrome
Open entrypoint.sh and edit
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar -role hub -port (custom port no.)
Then in dockerfile change EXPOES (custom port)
Then build docker again

How do you set up selenium grid using docker on windows?

Steps I have taken already
1. Downloaded and installed Docker Toolbox for windows
2. Open Docker Quickstart terminal
3. Entered the below commands to pull the docker images from dockerhub and run them
docker pull selenium/hub
docker pull selenium/node-chrome
docker pull selenium/node-firefox
docker run -d -P \--name hub selenium/hub
docker run -d --link hub:hub -P \--name chrome selenium/node-chrome
docker run -d --link hub:hub -P \--name firefox selenium/node-firefox
It appears to be running when I type docker logs hub but I am unable to route my tests to the hub's address on the virtualbox VM using seleniumAddress in my conf.js file or see it using http://ipAddress:4444/grid/console .
Ideally I would like to use this set up to expand the amount of parallel test instances I can run.
Unfortunately the selenium docker image might be broken since 4 days ago but you can try my alternative one:
Pull the image and run as many containers as you need
docker pull elgalu/selenium
docker run -d --name=grid4 -p 4444:24444 -p 5904:25900 \
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium
docker run -d --name=grid5 -p 4445:24444 -p 5905:25900 \
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium
docker run -d --name=grid6 -p 4446:24444 -p 5906:25900 \
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium
Wait until the all the grids started properly before starting the tests (Optional but recommended)
docker exec grid4 wait_all_done 30s
docker exec grid5 wait_all_done 30s
docker exec grid6 wait_all_done 30s
After this, Selenium should be up and running at http://localhost:4444/wd/hub. Open the url in your browser to confirm it is running.
If you are using Mac (OSX) or Microsoft Windows localhost won't work! Find out the correct IP through boot2docker ip or docker-machine ip default.
So set the selenium port accordingly for each of your test:
1st test should connect to http://ipAddress:4444/wd/hub
2nd test to http://ipAddress:4445/wd/hub
3rd test to http://ipAddress:4446/wd/hub
You can run as many as your hardware can take.
Take a look at the Protractor Cookbook w/ Docker. The instructions are listed step-by-step using selenium-grid and docker compose. Docker-selenium issue #208 has been fixed.
So you'll need to pull down the latest images*:
docker pull selenium/hub:latest
docker pull selenium/node-chrome-debug:latest
Start the selenium grid:
docker run -d -p 4444:4444 --name selenium-hub selenium/hub:latest
Then add selenium nodes. I like to use the chrome-debug and firefox-debug versions to VNC to watch the tests.
docker run -d -p <port>:5900 --link selenium-hub:hub selenium/node-chrome-debug:latest
After linking your selenium grid, this should be enough to run your Protractor test using the seleniumAddress: 'http://localhost:4444/wd/hub'.
For debugging, find the VNC port for the container with:
docker port <container-name or container-id> 5900
and access it via VNC Viewer.
Note:
At the time of this writing, 'latest' appears to be tied to a ~2.53.1 version of selenium server. As of Protractor 4.0.11 (the latest version of Protractor), this is the supported version that should be used. Note that the instructions on the Selenium-docker GitHub appear to be for tailored for selenium server 3.0.1.
You can use below compose file to setup grid and access via VNC
**# To execute this docker-compose yml file use docker-compose -f up
**# Add the "-d" flag at the end for deattached execution****
version: '2'
services:
firefoxnode:
image: selenium/node-firefox-debug
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
environment:
HUB_HOST: hub
ports:
- "32772:5900"
chromenode:
image: selenium/node-chrome-debug
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
environment:
HUB_HOST: hub
ports:
- "32773:5900"
hub:
image: selenium/hub
ports:
- "4444:4444"
command I use:
docker-compose -f .\docker-compose.yml up -d
Source :
https://github.com/SeleniumHQ/docker-selenium

Docker: Unable to view running container despite successful demo example

When I run the example from the Docker doc in the "Viewing our web application container" section, i.e.,
docker run -d -P training/webapp python app.py
...I'm able to view the "Hello World" output in a browser. Success. This seems to indicate that the network I'm on may not be the problem.
Now I'm trying to view a container that runs a webdriver suite (test automation of a browser). Based on the output in docker logs -f, the webdriver suite runs to completion. But when I try to point a browser at the webdriver container (which is running the browser), I get a error saying:
ERR_CONNECTION_REFUSED
Here are the steps I'm following:
Start webdriver container with this command
docker run -d -p 8080:5000 "/bin/bash" "-c" "/dir1/dir2/filename.sh $PARAMETER1 $PARAMETER2"
point a browser to:
http://subdomain.mydomain.com:5000
Docker output:
user#server$ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2fa83fc0401a 65525ab9ad78 "/bin/bash -c '/opt/y" 55 minutes ago Up 55 minutes 2222/tcp, 0.0.0.0:8080->5000/tcp
user#server$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' 2fa83fc0401a
111.22.33.4444
Other info:
Server config: Ubuntu 14.04
Docker version: 1.8.1, build d12ea79
I've reviewed the following questions but I'm not running on a VM and I'm not running NodeJS.
Unable to view rails app running in docker container from browser
Docker: Unable to specify port for a running container
Does anyone have suggestions on how I might troubleshoot this problem? Any assistance gratefully accepted.
:) jay
Update 1:
Based on the NodeJS question noted above, I'm thinking that I'm not setting a port correctly in the Dockerfile. Maybe this is as simple as setting the correct port for Selenium?
Update 2: as #hunter noted, I had the ports in the wrong order, but switching the ports does not resolve the problem. I think the bigger problem is that I was assigning the wrong port. So, I changed docker run -d -p 8080:5000 to docker run -d -P. When I did that, I got the following output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
f375251b61d7 65525ab9ad78 "/bin/bash -c '/opt/y" About an hour ago Up About an hour 0.0.0.0:33073->2222/tcp
I then pointed the browser to that port: http://subdomain.mydomain.com:33073
But I still get the same error: ERR CONNECTION REFUSED
I think you're using the wrong port - the external port is 8080 not 5000.