Setting up Grid

1,005 views
Skip to first unread message

Javier Garcia

unread,
Jul 26, 2011, 8:34:44 AM7/26/11
to Selenium Users
Hi

I am trying to test using Grid2. I have an ie9 browser in a Windows7
VM

First i start the hub
java -jar selenium-server-standalone-2.2.0 -role hub

In the remote host i register the node
java -jar selenium-server-standalone-2.2.0.jar -role webdriver -
hub http://10.128.24.28:4444/grid/register -port 5556 -browser
"browserName=internet explorer,version=9,platform=WINDOWS"

I get the message "Registering the node to hub..."


And now is when i run my code in my local machine
DesiredCapabilities capability =
DesiredCapabilities.internetExplorer();
capability.setVersion("9");
driver = new RemoteWebDriver(new URL("http://localhost:
4444/wd/hub"), capability);
.......

At this point the execution gets blocked and i am not able to go any
further.
Anybody knows what am i doing wrong?

Thanks

Eric Bass

unread,
Jul 26, 2011, 3:52:42 PM7/26/11
to seleniu...@googlegroups.com
are you running the code below on the same machine that the hub is on?  if not you should replace localhost with either the hostname or the IP address of the hub server.


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


Javier Garcia Paredero

unread,
Jul 27, 2011, 2:17:34 AM7/27/11
to seleniu...@googlegroups.com
Yes. Actually if i open in the browser http://localhost:4444/grid/console I can see the following

1 requests waiting for a slot to be free.
  • {platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=9}
Looks like it cannot find the node


2011/7/26 Eric Bass <3m8...@gmail.com>

Krishnan Mahadevan

unread,
Jul 28, 2011, 2:30:11 AM7/28/11
to seleniu...@googlegroups.com
Javier, if the node is not available, I have seen the Grid throw back an error saying capability not present. I havent seen it wait.

If the capability matching is indeed the problem, then you have a couple of options.

1. Spawn the webdriver node that is hooked to the hub with a nodeConfig file (u have to use the -nodeConfig parameter) and define capabilities such that the grid can redirect the request to the node.
2. Revisit your code, get away from using DesiredCapabilities c = DesiredCapabilities.internetExplorer() and instead use the following

DesiredCapabilities c = new DesiredCapabilities();
c.setBrowserName(DesiredCapabilites.internetExplore().getBrowserName());

and then retry. Hope that helps.

Thanks & Regards
Krishnan Mahadevan

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

dan_null

unread,
Jul 28, 2011, 9:13:15 PM7/28/11
to Selenium Users
I have the same issue as Javier. Using the standalone server 2.2.0. It
hangs when I create a node on one machine which specifies a hub on a
different machine. After I run the command to start the node, I check
the grid/console webpage of my hub and it displays that it is
listening to my node momentarily. Upon refresh, it says (cannot rbe
reached at the moment). Creating a node on the same machine as the hub
works fine. I run the test case anyways (the hub is not listening to
nodes that are on the same machine) and here is the output. I tried
variations of nodes and hubs using standalone 2.2.0 and 2.1.0, and it
all seems to be the same problem. It seems to have know about the node
somehow because, if I run the node, it will hang, and eventually in
the hub's URL/grid/console webpage it say that the node cannot be
reached. However, if I kill the node, and rerun the same command
(using the same port I previously tried using with the node), in the
hub's terminal, it prints a warning saying:

WARNING: Proxy 'URL :htttp://192.168.10.1:7773/wd/hub time out :
300000' was previously registered. Cleaning up any stale test
sessions.

Thanks for the help in advanced!

-Daniel

On Jul 27, 11:30 pm, Krishnan Mahadevan
<krishnan.mahadevan1...@gmail.com> wrote:
> Javier, if the node is not available, I have seen the Grid throw back an
> error saying capability not present. I havent seen it wait.
>
> If the capability matching is indeed the problem, then you have a couple of
> options.
>
> 1. Spawn the webdriver node that is hooked to the hub with a nodeConfig file
> (u have to use the -nodeConfig parameter) and define capabilities such that
> the grid can redirect the request to the node.
> 2. Revisit your code, get away from using DesiredCapabilities c =
> DesiredCapabilities.internetExplorer() and instead use the following
>
> DesiredCapabilities c = new DesiredCapabilities();
> c.setBrowserName(DesiredCapabilites.internetExplore().getBrowserName());
>
> and then retry. Hope that helps.
>
> Thanks & Regards
> Krishnan Mahadevan
>
> "All the desirable things in life are either illegal, expensive, fattening
> or in love with someone else!"
>
> On Wed, Jul 27, 2011 at 11:47 AM, Javier Garcia Paredero <
>
>
>
>
>
>
>
> garcia.pared...@gmail.com> wrote:
> > Yes. Actually if i open in the browserhttp://localhost:4444/grid/consoleIcan see the following
>
> > 1 requests waiting for a slot to be free.
>
> >    - {platform=WINDOWS, ensureCleanSession=true, browserName=internet
> >    explorer, version=9}
>
> > Looks like it cannot find the node
>
> > 2011/7/26 Eric Bass <3m8...@gmail.com>
>
> >> are you running the code below on the same machine that the hub is on?  if
> >> not you should replace localhost with either the hostname or the IP address
> >> of the hub server.
>
> >> On Tue, Jul 26, 2011 at 8:34 AM, Javier Garcia <garcia.pared...@gmail.com
> >> > wrote:
>
> >>> Hi
>
> >>> I am trying to test using Grid2. I have an ie9 browser in a Windows7
> >>> VM
>
> >>> First i start the hub
> >>>      java -jar selenium-server-standalone-2.2.0 -role hub
>
> >>> In the remote host i register the node
> >>>      java -jar selenium-server-standalone-2.2.0.jar -role webdriver -
> >>> hubhttp://10.128.24.28:4444/grid/register-port 5556 -browser

Javier Garcia Paredero

unread,
Jul 29, 2011, 4:06:52 AM7/29/11
to seleniu...@googlegroups.com
Thanks for the help Krishnan

I'll try what you say



2011/7/28 Krishnan Mahadevan <krishnan.ma...@gmail.com>

dan_null

unread,
Jul 29, 2011, 2:16:01 PM7/29/11
to Selenium Users
Hi Krishnan,

Thanks for your help! I was curious if you were using JSON for the
nodeConfig file. Also, do you think you can post an example of one of
your nodeConfig file? I think it might be useful to be in the future.
Thanks a bunch for your all your help! Your awesome!

- Daniel Barajas

On Jul 28, 6:13 pm, dan_null <i.am.bara...@gmail.com> wrote:
> I have the same issue as Javier. Using the standalone server 2.2.0. It
> hangs when I create a node on one machine which specifies a hub on a
> different machine. After I run the command to start the node, I check
> thegrid/console webpage of my hub and it displays that it is
> listening to my node momentarily. Upon refresh, it says (cannot rbe
> reached at the moment). Creating a node on the same machine as the hub
> works fine. I run the test case anyways (the hub is not listening to
> nodes that are on the same machine) and here is the output.  I tried
> variations of nodes and hubs using standalone 2.2.0 and 2.1.0, and it
> all seems to be the same problem. It seems to have know about the node
> somehow because, if I run the node, it will hang, and eventually in
> the hub's URL/grid/console webpage it say that the node cannot be
> reached. However, if I kill the node, and rerun the same command
> (using the same port I previously tried using with the node), in the
> hub's terminal, it prints a warning saying:
>
> WARNING: Proxy 'URL :htttp://192.168.10.1:7773/wd/hub time out :
> 300000' was previously registered. Cleaning up any stale test
> sessions.
>
> Thanks for the help in advanced!
>
> -Daniel
>
> On Jul 27, 11:30 pm, Krishnan Mahadevan
>
>
>
>
>
>
>
> <krishnan.mahadevan1...@gmail.com> wrote:
> > Javier, if the node is not available, I have seen theGridthrow back an
> > error saying capability not present. I havent seen it wait.
>
> > If the capability matching is indeed the problem, then you have a couple of
> > options.
>
> > 1. Spawn the webdriver node that is hooked to the hub with a nodeConfig file
> > (u have to use the -nodeConfig parameter) and define capabilities such that
> > thegridcan redirect the request to the node.
> > 2. Revisit your code, get away from using DesiredCapabilities c =
> > DesiredCapabilities.internetExplorer() and instead use the following
>
> > DesiredCapabilities c = new DesiredCapabilities();
> > c.setBrowserName(DesiredCapabilites.internetExplore().getBrowserName());
>
> > and then retry. Hope that helps.
>
> > Thanks & Regards
> > Krishnan Mahadevan
>
> > "All the desirable things in life are either illegal, expensive, fattening
> > or in love with someone else!"
>
> > On Wed, Jul 27, 2011 at 11:47 AM, Javier Garcia Paredero <
>
> > garcia.pared...@gmail.com> wrote:
> > > Yes. Actually if i open in the browserhttp://localhost:4444/grid/consoleIcansee the following
>
> > > 1 requests waiting for a slot to be free.
>
> > >    - {platform=WINDOWS, ensureCleanSession=true, browserName=internet
> > >    explorer, version=9}
>
> > > Looks like it cannot find the node
>
> > > 2011/7/26 Eric Bass <3m8...@gmail.com>
>
> > >> are you running the code below on the same machine that the hub is on?  if
> > >> not you should replace localhost with either the hostname or the IP address
> > >> of the hub server.
>
> > >> On Tue, Jul 26, 2011 at 8:34 AM, Javier Garcia <garcia.pared...@gmail.com
> > >> > wrote:
>
> > >>> Hi
>
> > >>> I am trying to test using Grid2. I have an ie9 browser in a Windows7
> > >>> VM
>
> > >>> First i start the hub
> > >>>      java -jar selenium-server-standalone-2.2.0 -role hub
>
> > >>> In the remote host i register the node
> > >>>      java -jar selenium-server-standalone-2.2.0.jar -role webdriver -
> > >>> hubhttp://10.128.24.28:4444/grid/register-port5556 -browser

dan_null

unread,
Jul 29, 2011, 2:24:39 PM7/29/11
to Selenium Users
Javier,

I had a similar problem you did. I had two machines, one that created
the hub and a node, and another that create second node. When I
created the node on the remote machine I was getting the same issue
you were which was it would hang on the message ("Registering the node
to hub..." ), but when I had the same command to start up a node on
the same machine as the hub it worked fine (That terminal would have
alot more output and periodically output a status message). I was able
to fix my problem which happened to be a networking issue. You might
not have the same problem, but you should check out my separate post
in case it is:

http://groups.google.com/group/selenium-users/browse_thread/thread/a6eb2893083410fa#


Hope you can figure it out.

-Daniel Barajas

On Jul 29, 1:06 am, Javier Garcia Paredero <garcia.pared...@gmail.com>
wrote:
> Thanks for the help Krishnan
>
> I'll try what you say
>
> 2011/7/28 Krishnan Mahadevan <krishnan.mahadevan1...@gmail.com>
>
>
>
>
>
>
>
> > Javier, if the node is not available, I have seen the Grid throw back an
> > error saying capability not present. I havent seen it wait.
>
> > If the capability matching is indeed the problem, then you have a couple of
> > options.
>
> > 1. Spawn the webdriver node that is hooked to the hub with a nodeConfig
> > file (u have to use the -nodeConfig parameter) and define capabilities such
> > that the grid can redirect the request to the node.
> > 2. Revisit your code, get away from using DesiredCapabilities c =
> > DesiredCapabilities.internetExplorer() and instead use the following
>
> > DesiredCapabilities c = new DesiredCapabilities();
> > c.setBrowserName(DesiredCapabilites.internetExplore().getBrowserName());
>
> > and then retry. Hope that helps.
>
> > Thanks & Regards
> > Krishnan Mahadevan
>
> > "All the desirable things in life are either illegal, expensive, fattening
> > or in love with someone else!"
>
> > On Wed, Jul 27, 2011 at 11:47 AM, Javier Garcia Paredero <
> > garcia.pared...@gmail.com> wrote:
>
> >> Yes. Actually if i open in the browserhttp://localhost:4444/grid/consoleIcan see the following
>
> >> 1 requests waiting for a slot to be free.
>
> >>    - {platform=WINDOWS, ensureCleanSession=true, browserName=internet
> >>    explorer, version=9}
>
> >> Looks like it cannot find the node
>
> >> 2011/7/26 Eric Bass <3m8...@gmail.com>
>
> >>> are you running the code below on the same machine that the hub is on?
> >>> if not you should replace localhost with either the hostname or the IP
> >>> address of the hub server.
>
> >>> On Tue, Jul 26, 2011 at 8:34 AM, Javier Garcia <
> >>> garcia.pared...@gmail.com> wrote:
>
> >>>> Hi
>
> >>>> I am trying to test using Grid2. I have an ie9 browser in a Windows7
> >>>> VM
>
> >>>> First i start the hub
> >>>>      java -jar selenium-server-standalone-2.2.0 -role hub
>
> >>>> In the remote host i register the node
> >>>>      java -jar selenium-server-standalone-2.2.0.jar -role webdriver -
> >>>> hubhttp://10.128.24.28:4444/grid/register-port 5556 -browser

Krishnan Mahadevan

unread,
Aug 1, 2011, 3:24:30 AM8/1/11
to seleniu...@googlegroups.com
Dan,
I do use a nodeConfig file to spawn my nodes.

My nodeconfig JSON file looks as below:


{
"capabilities":
    [
        {
            "browserName":"firefox",
            "maxInstances":1
        },
        {
            "browserName":"chrome",
            "maxInstances":1
        },
        {
            "browserName":"internet explorer",
            "maxInstances":1
        }
    ],
"configuration":
    {
        "cleanUpCycle":2000,
        "timeout":30000,
        "proxy":"org.openqa.grid.selenium.proxy.WebDriverRemoteProxy",
        "maxSession":1,
        "url":"http://localhost:5555/wd/hub",
        "port":"5555",

    }
}

Thanks & Regards
Krishnan Mahadevan

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


Poojan dave

unread,
Dec 10, 2014, 11:13:28 AM12/10/14
to seleniu...@googlegroups.com, garcia....@gmail.com
set driver.quit(); at the end of your scripts
Reply all
Reply to author
Forward
0 new messages