Step by step guide on how to use grid 2 with sample configuration

2,618 views
Skip to first unread message

Dreamer

unread,
Sep 21, 2011, 6:06:41 AM9/21/11
to webdriver
Is there a reasonable detailed or at least half decent how to for
selenium Grid 2 for those who have no experience with the old Grid.
All the tutorials I have seen assume knowledge of Grid 1. Any sample
or default configuration files would also be handy. WE currently use
Jenkins to schedule our builds, we currently run all our test serially
which sucks!. We inject the browser type into each test.

Dreamer

unread,
Sep 21, 2011, 6:06:42 AM9/21/11
to webdriver

Krishnan Mahadevan

unread,
Sep 21, 2011, 6:54:04 AM9/21/11
to webd...@googlegroups.com
Here's how you can do it.

1. download the selenium server standalone from : http://selenium.googlecode.com/files/selenium-server-standalone-2.6.0.jar
2. Open a command prompt and cd into the directory wherein you downloaded the jar.
3. Now run this command to start the hub [ java -jar selenium-server-standalone-2.6.0.jar -role hub ] Please donot copy paste this, but type it out, since I have seen copy paste causing errors.
4. Now repeat step (2) alone.
5. Now to spawn a webdriver node instance run the command [java -jar selenium-server-standalone-2.6.0.jar -role -hub http://localhost:4444/grid/register -port 5556] 

That should do, you now have a hub and a webdriver node which can support
5 instances of FF
5 instances of chrome
1 instance of IE.

If you want to control the instances of each of the browser flavors, run the command highlighted in step (5) with an additional parameter called nodeConfig.

So your new command would be :

java -jar selenium-server-standalone-2.6.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5556 -nodeConfig webconfig.txt

Here webConfig.txt would be a text file as here : https://gist.github.com/1106418

Note: If you would like to spawn a selenium rc node instead of webdriver node, just change the role value from "webdriver" to "remotecontrol"

Hope that helps you get started !

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.


Krishnan Mahadevan

unread,
Sep 21, 2011, 6:59:16 AM9/21/11
to webd...@googlegroups.com
Correction on step (5)

it should be

5. Now to spawn a webdriver node instance run the command [java -jar selenium-server-standalone-2.6.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5556] 

** I missed the webdriver for the role parameter **

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



niharika varshney

unread,
Sep 21, 2011, 7:06:22 AM9/21/11
to webd...@googlegroups.com
http://code.google.com/p/selenium/wiki/Grid2 - I hope you haven't missed this link.. 
pretty much everything that you need ..

Regards,
Niharika

Pushpraj Singh

unread,
May 9, 2013, 8:43:46 AM5/9/13
to webd...@googlegroups.com
@Krishnan
So far , what you narrated in those points is done, but
1. how tests gonna know which test to run on which browser. Does that require to make some changes in testng.xml and to use @Parameter annotation in my base class where I am using before-after methods
2. How can I run same test case on my adjacent windows8 laptop (remote machine , connected with LAN), this machine doesn't have any file that supports running those test cases like jars etc

Please explain...many thanks

@Niharika
I went to that link, it was nice...
Reply all
Reply to author
Forward
0 new messages