0
votes

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:

  1. I have downloaded selenium-server-standalone-3.9.1.jar + Chrome Driver & placed it in a folder and added it to $PATH environmental variable.

  2. 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:

  1. I have installed selenium-webdriver & selenium-server-standalone-3.9.1.jar

  2. I wrote a sample testcase using selenium webdriver.

  3. 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.

  4. 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) Terminal Remote Machine Node:(Local) Terminal in Local Machine

Can you please explain me the mistake I have did here? Have I understood the concept wrong?

2
From your question and counter questions to the provided answers I think there is a mis-match between your expectation and usage of selenium-server-standalone-3.9.1.jar. Your question heading mentions about Selenium Standalone Server logically which doesn't exists. You must have meant Selenium Server and you tagging selenium-server makes this feeling more stronger . But your steps says you are trying out Selenium Grid Configuration where you haven't provided the minimum configuration to run any Test . Finally, I am surprised to see you tagging selenium-rc. Can you help us? - DebanjanB

2 Answers

0
votes

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).

0
votes

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)