Connect a node to a hub with selenium grid 4 - selenium-grid

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

Related

Selenium grid with notes available through WireGuard

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.

Selenium Grid -- Hub and Node performance issue

I am trying to run Selenium Grid.
Currently, I'm using v3.8.1 with one hub on 1 network and 20+ nodes of different networks registering to that Selenium hub.
It's executing fast when hub and node are created on the same machine where the application has deployed. Nodes created in other remote machines are comparatively slow.
Slow when we try to access particular Node by passing applicationName in capability instead of HUB selecting the node randomly.
More Info:
Windows server 2008, Ruby gem - selenium-webdriver-2.53.4, selenium-server-standalone-3.8.1, Java 8.
Tried Selenium Grid versions - 2.48, 2.49, 2.52, 2.53 and 3.8.1 as per https://github.com/SeleniumHQ/selenium/issues/1565.
Any help on this is appreciated. Thank You.
At last I got it. Its not a selenium node performance issue.
Its a rdp performance issue as it has shared resources.
Its working fine in individual VMs and in server machine.
Thanks You.

Selenium Standalone server

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)

How to launch the browser on client side using selenium webdriver

I am new to selenium. I am developed one application using a selenium web driver for doing some actions on the webpage. It's perfectly working when I am running locally i.e., it launches a browser in my machine. I deployed this application on a VM server so the script runs on the server(launched browser in VM Ware Machine), not on the client-side. Can anyone help me with how can I launch the browser on the client-side?
You have to create Hub and Nodes using selenium grid
You can refer this link to see step by step
http://www.seleniumeasy.com/selenium-tutorials/how-to-configure-selenium-grid
Your server will be hub and your client machine will be node
If you trigger from one machine, you can launch a browser on another machine using the selenium-grid concept
But both machines are under the same LAN.
Here you want to execute on the client machine. It is not possible, because your machine and client machine won't be under the same network

Need a machine to run selenium Grid test cases

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.