I am running the Selenium Grid Server on my Mac and I'm trying to add my Raspberry Pi as a node to it with the command:
java -jar selenium-server.jar node --detect-drivers true --publish-events tcp://192.168.3.45:4442 --subscribe-events tcp://192.168.3.45:4443
On the Pi it keeps logging out "Sending registration event..." and on the Mac in the Selenium event bus it says io.netty.channel.ConnectTimeoutException: connection timed out: /169.254.110.233:5555
Does anyone have an idea why it's saying this or has anyone been able to add a Pi as a Selenium node?
Related
So I'm trying to setup an automated build and test flow, with Jenkins and Selenium grid on a central EC2-instance and nodes on physical machines located at my office.
I don't have port forwarding available at my office.
So I was thinking that I could use a VPN (not a proxy) to connect the machines, as though they were on the same network.
So my setup is currently:
The hub (EC2) with Wireguard
java -jar selenium-server-4.7.2.jar hub --host 0.0.0.0 --allow-cors true --bind-host false
A linux-laptop node
java -jar selenium-server-4.7.2.jar node --hub http://<wireguard-hub>:4444 --host <wireguard-ip> --port 5555 --bind-host false
A windows desktop node
java -jar selenium-server-4.7.2.jar node --hub http://<wireguard-hub>:4444 --host <wireguard-ip> --port 5555 --bind-host false
The nodes are able to do a GET-request to the hub and get a proper json response and the hub is able to do the opposite. But the Selenium software get stuck on [NodeServer$1.lambda$start$1] - Sending registration event....
I've tried running all parties with --log-level FINEST, but all I see is that the hub isn't receiving the request. Both from linux and windows.
I've tried running both nodes as hubs too and they are able to connect to themselves, but not each other (through WireGuard).
So can anyone tell me why I can, but at the same time can't, connect my grid?
EDIT (4. jan 2022):
I have now tried running the node on the same EC2-instance with docker as the Webdriver and that doesn't work either.
The node starts, connects to docker and gets stuck at the same spot.
This (in my mind) points to it being an issue with the EC2-instance.
For now I'll be running it in standalone mode, to get the rest of the pipeline working.
I'm trying to connect 2 vm machines with each other (running both on win10).
I've downloaded java JDK 15 and
selenium-server-4.0.0-alpha-6.jar
I'm running my hub, copying the TCP URL I get there (tcp://hub:4442/3) to my second machine.
But after running the node command I'm getting this message:
Starting registration process for node ID X
and everything hangs...
I've tried testing if there is a connection using Test-NetConnection and it seems that there is communication between them
How can I debug this?
OK found the solution.
It seems that in alpha 6, if you don't have a browser web driver installed it won't work
I want to run the selenium test cases in the remote machine.
These are the steps I have followed:
Steps I did in server machine:
I have downloaded selenium-server-standalone-3.9.1.jar + Chrome Driver & placed it in a folder and added it to $PATH environmental variable.
I have started selenium server using java -jar selenium-server-standalone-3.9.1.jar -role hub in the Terminal.
Steps I did in local machine:
I have installed selenium-webdriver & selenium-server-standalone-3.9.1.jar
I wrote a sample testcase using selenium webdriver.
I have started a node here using command java -jar selenium-server-standalone-3.9.1.ja-role node -hub http://172.24.111.70:4444/grid/register in the terminal. The node got connected to the hub.
I run the command node test.js in the terminal. I expect the chrome instance to open in the remote machine. But it is running in the local machine.
Screenshots:
Hub:(Remote)
Node:(Local)
Can you please explain me the mistake I have did here? Have I understood the concept wrong?
The web browser instance which will run your tests will get created on a node not the hub. The hub is how you can register a number of nodes so you can spread the load between different machines/nodes. From what I can tell, you have a hub on the remote machine which you connect a local node to.
What I think you want is to run the node on the remote machine also, registering to the hub on the same machine (you might have to change the IP address of the hub to localhost when registering the node).
So, the problem is you are wanting the tests to run on the Remote Machine, but they are running locally?
From the sounds of it you have done all the setup correctly, and the Hub/Nodes should be working fine. All you need to do, is instead of running the Node from your local machine, run it from the Remote Machine. You just need to think of the Hub as the Supervisor, who hands out work to the Nodes (their employees) to do. The Hub doesn't run any tests itself, it just sends the data to the Nodes and load balances between multiple Nodes.
We have a set up of 6 Remote Machines. Machine 1 has the Hub and a Node, and the other 5 have Nodes. In our project we are pointing towards the Hub, so when the tests run, they get sent there. The hub does the rest (depending on the nodecfg file and the settings you've got in there)
While setting up Selenium Grid:
Windows as Hub
Mac as Node
While registering node in mac, the below error is displayed:
Couldn't register this node: The hub is down or not responding: The hub responded with 305: Use Proxy
Note:
(1) Able to setup Selenium Grid successfully, By
-> Windows as Hub and Node
-> Mac as Hub and Node.
-> Mac as Hub and Windows as Node
(2) Able to connect RDP from Windows to Mac
I would like to check my selenium grid test cases on a server(any machine other than localhost).I need chrome , firefox and IE browsers in the server. Is there any way to do this ? I checked few sites like koding.com , but it is only offering me unix interface,I need full windows/Ubuntu interface.
Please let me know if there is any other method to execute my test cases ?
VirtualBox is good and works well for grid tests, I expect it to be a fairly common solution. Same IP is not a problem as you make it work with port forwarding on your desktop. For example you should manage to build a grid like the following:
-role hub on your Windows host on port 4444
-role node on an Ubuntu VM with port forward 5556 in VirtualBox, for Firefox
-role node on an OSX VM with port forward 5557 in VirtualBox, for Safari
-role node on a Windows VM with port forward 5558 in VirtualBox, for IE and Chrome
node with socat+flynnid.py on an Android emulator with port forward 5559
maybe also iPhone Simulator from inside OSX VM (I don't remember if I made it work with grid)
The Selenium Grid "user interface" as you say, is the same , whether it is Linux or Windows. The only difference is that on Linux you won't have an IE driver.
What you do is run a Grid Hub on your local machine and then register "Node" servers on each remote machine. Each Node server can run any combination of web browsers that you mentioned and it is also capable of running them simultaneously (if your test suite was programmed carefully).
The .jar file that you start the Grid Hub with is the same .jar file you use to start the Nodes. The only difference is that each Node will have a .json config file with it that explains the configuration of that server such as where the IE and Chrome binary files are located at on the remote server, what browsers it supports, and how many threads it can handle.
Look at the documentation I wrote (for Grid hub config) on the GitHub "Selenium documentation" site.