Reputation: 133
I have implemented Selenium Grid by reading and understanding from the sparse/fragmented online documentation about Grid2. My current implementation is-
Webdriver node registered and running on EC2 instance
java -jar selenium-server-standalone-2.8.0.jar -role webdriver -hub http://EC2_PUBLIC_IP:5555/grid/register -port 5556
Hub registered and running on same EC2 instance
java -jar selenium-server-standalone-2.8.0.jar -role hub -hubhost EC2_PUBLIC_IP -port 5555
I am running my Webdriver based TestNG tests from Eclipse on my local machine. The driver configuration is driver = new RemoteWebDriver(new URL("http://EC2_PUBLIC_IP:5556/wd/hub"), capability);
Running the tests launches the browser on my EC2 instance.
I am still looking for a few unanswered questions that may be very basic and would appreciate people's views or understanding on them. I want to have my browsers launched on a machine that has respective Node running on it. e.g- A machine running webdriver+firefox node should launch respective test.
I was able to achieve this by opening ports 5554-5559 on my EC2 instance from the AWS portal and also the firewall for these ports on my local as well as EC2 machine.
Please let me know if I am unclear, or ambiguous at any point. Would appreciate your explanations.
Upvotes: 2
Views: 2955
Reputation: 2319
There's no special considerations for running grid on EC2 versus any other networking environment. Everything is done via HTTP on ports you can configure. Since you almost certainly don't want your grid publicly exposed and everything in the default security group can talk to everything else on the same network, you shouldn't have any problems.
You can either configure things from the command-line or through a JSON configuration file. I prefer the latter. The default configuration file can be found on Google Code. You'll note the "hubPort" value there. Not shown, but valid, is a "hubHost" configuration item. Just set that to the hostname of the hub.
When you launch your node, supply the "-nodeConfig /path/to/my/node_config.json" command-line argument and you'll be good to go.
Upvotes: 2