!!

Welcome to Selenium Webdriver Forum

As a web user you can read and search through forum content. Once you have registered and signed you can post topics, post replies, set up watch lists, modify forum settings, and use private messaging.

Author Topic: Grid2 problem without SeleneseCommandExecutor  (Read 1050 times)

h k

  • Web User
Grid2 problem without SeleneseCommandExecutor
« on: April 01, 2012, 06:37:25 PM »
I cannot get Grid2 to work following the example in
 http://code.google.com/p/selenium/wiki/Grid2
 Java commands to start Grid2:
   java -jar selenium-server-standalone-2.13.0.jar -role hub
   java -jar selenium-server-standalone-2.13.0.jar -role node -hub
 http://localhost:4444/grid/register
 Grid Hub shows up correctly in http://localhost:4444/grid/console
 
Grid2 only works when I call SeleneseCommandExecutor:
   DesiredCapabilities capabilities = DesiredCapabilities.firefox();
   CommandExecutor executor = new SeleneseCommandExecutor(
     new URL("http://localhost:5555"), new URL("http://
 www.google.com"), capabilities);
   driver = new RemoteWebDriver(executor, capabilities);
 
If I change the above lines to:
   DesiredCapabilities capabilities = DesiredCapabilities.firefox();
   driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/
 hub" ), capabilities);
 a blank browser shows up and I got the following error:
 
org.openqa.selenium.WebDriverException: Error communicating with the
 remote browser. It may have died.
 Build info: version: '2.13.0', revision: '14794', time: '2011-11-18
 17:49:47'
 System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
 java.version: '1.7.0_01'
 Driver info: driver.version: RemoteWebDriver
         at
 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
 412)
         at
 org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:
 118)
         at
 org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
 79)
         at
 org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
 87)
         at tmp.setUp(tmp.java:36)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.junit.runners.model.FrameworkMethod
 $1.runReflectiveCall(FrameworkMethod.java:45)
         at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:
 15)
         at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:
 42)
         at
 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
 27)
         at
 org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
 30)
         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
         at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
 68)
         at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
 47)
         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
         at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
 49)
         at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
 38)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
 467)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
 683)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
 390)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
 197)
 Caused by: org.apache.http.conn.HttpHostConnectException: Connection
 to http://localhost:4444 refused
         at
 org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
 158)
         at
 org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
 149)
         at
 org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
 121)
         at
 org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:
 573)
         at
 org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
 425)
         at
 org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
 820)
         at
 org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:
 392)
         at
 org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:
 371)
         at
 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
 398)
         ... 28 more
 Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
         at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
         at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at
 org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:
 123)
         at
 org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
 148)
         ... 36 more
 
java.lang.NullPointerException
         at tmp.tearDown(tmp.java:66)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.junit.runners.model.FrameworkMethod
 $1.runReflectiveCall(FrameworkMethod.java:45)
         at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:
 15)
         at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:
 42)
         at
 org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
 36)
         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
         at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
 68)
         at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
 47)
         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
         at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
 49)
         at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
 38)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
 467)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
 683)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
 390)
         at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
 197)
 
Thanks,
 Henry

Krishnan Mahadevan

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #1 on: April 01, 2012, 06:37:47 PM »
Henry,
 I have been using Grid for quite sometime and I havent faced any problems.
 The stacktrace mentions "connection refused".
 
Are you running your code in the same machine as where grid exists or is it
 in a different machine ?
 
Thanks & Regards
 Krishnan Mahadevan
 
"All the desirable things in life are either illegal, expensive, fattening
 or in love with someone else!"
 

- Show quoted text -

Frank Escobar

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #2 on: April 01, 2012, 06:38:00 PM »
I have the same problem. I think that the problem are the differents
 speeds of each browser. For example: Internet Explorer is slower than
 Firefox.
 The temporary solution that I applied is create a thread that wait while
 load the page:
 Thread.sleep(3000);
 
*Exist some method that wait the load page according the browser?*
 *
 *
 
On Wed, Nov 30, 2011 at 4:24 AM, Krishnan Mahadevan <
 


- Show quoted text -

--
 *Frank Escobar | QA Analyst | GlobalLogic Inc.*
 *Leaders in Software R&D Services*
 *ARGENTINA | CHILE  |  CHINA | INDIA | ISRAEL | UKRAINE | UK | USA
 485 Av Corrientes, 6th floor - Bs. As.
 **Home: +54-261-4290866 **| ...
 read more »

Selenium Webdriver

Re: Grid2 problem without SeleneseCommandExecutor
« Reply #2 on: April 01, 2012, 06:38:00 PM »

h k

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #3 on: April 01, 2012, 06:38:14 PM »
Krishnan,
 Same machine as the grid.
 
Henry
 
On Nov 29, 11:24 pm, Krishnan Mahadevan
 

- Show quoted text -

h k

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #4 on: April 01, 2012, 06:38:26 PM »
Frank,
 Where do you add Thread.sleep(3000) ?  The error is at the 2nd line
 "driver = ..." shown below:
 
  DesiredCapabilities capabilities = DesiredCapabilities.firefox();
   driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/
 hub" ), capabilities);    // ERROR at this line
 
Henry
 
On Nov 30, 5:54 am, Frank Escobar <fescobar.syst...@gmail.com> wrote:
 

- Show quoted text -

 ... read more »

Mike

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #5 on: April 01, 2012, 06:38:40 PM »
Don't bother, because adding a sleep won't help, plus it is not the
 way to write test code.  You are failing to properly start the browser
 in the first place.  IT sounds like it sort of starts and then can't
 communicate.
 I seem to recall having a problem when I was using the name
 "localhost" as you are here.  Try using the IP: 127.0.0.1
 
My code passes the IP address for the hub as a parameter from the
 command line, as well as the port to use, but here is how I am
 invoking it:
     driver = new RemoteWebDriver(new URL("http://" + host + ":" + port
                                          + "/wd/hub"), capability);
 
And Frank, try waiting for the title to change or an expected element
 from the destination web page to be present.  Your test will run much
 faster than if you scatter sleeps throughout your code.  It is okay to
 sleep for .1 seconds or so in between checks, just to be sociable so
 other tasks can run while you are waiting.
 
Mike
 
On Nov 30, 10:06 am, h k <hhk0...@gmail.com> wrote:
 

- Show quoted text -

h k

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #6 on: April 01, 2012, 06:38:54 PM »
Mike,
 You are right.  It's a connection problem, partially connected since a
 blank browser shows up.  I tried replacing "localhost" with the IP
 address of my machine, but to no avail.
 
Henry
 
On Nov 30, 10:30 am, Mike <lvskip...@cox.net> wrote:
 

- Show quoted text -

Krishnan Mahadevan

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #7 on: April 01, 2012, 06:39:09 PM »
Henry,
 Just a guess. Have you tried using your actual IP address instead of
 127.0.0.1 and see if that works ? (you can get the ip by using the ipconfig
 command)
 
Alternatively I think you can perhaps try exploring altering your hosts
 file under c:\windows\system32\drivers\etc\hosts directory to explicitly
 refer to your local host machine and see if that helps as well?
 Thanks & Regards
 Krishnan Mahadevan
 
"All the desirable things in life are either illegal, expensive, fattening
 or in love with someone else!"
 

- Show quoted text -

h k

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #8 on: April 01, 2012, 06:39:24 PM »
Krishnan,
 Same problem with localhost or the actual IP address of my machine.
 
Henry
 
On Nov 30, 8:46 pm, Krishnan Mahadevan
 

- Show quoted text -

Krishnan Mahadevan

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #9 on: April 01, 2012, 06:39:41 PM »
I am out of options :(
 
Thanks & Regards
 Krishnan Mahadevan
 
"All the desirable things in life are either illegal, expensive, fattening
 or in love with someone else!"
 

- Show quoted text -

Panchdev Chauhan

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #10 on: April 01, 2012, 06:39:58 PM »
Just tell me which version of firefox installed on node machine.
 Inform you in advance that If FF version is 8.0.1 on XP, it will not work.
 Because 8.0.1 is not been supported yet. If this is the case Please change
 you FF to 7.0.0. and try out. definitely It will work. Enjoy.
 
On Fri, Dec 2, 2011 at 9:06 AM, Krishnan Mahadevan <
 


- Show quoted text -

--
 Regards,
 *PANCHDEV CHAUHAN*
 Software Engineer in Test
 *"Quality is the job I do."*
 *
 *
 @nuFuture Digital (India) Limited.
 @Mobile: 88 66 268 514
 @Public Profile: http://in.linkedin.com/pub/panchdev-chauhan/18/290/325
 
*
 *

Krishnan Mahadevan

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #11 on: April 01, 2012, 06:40:18 PM »
@Panchdev
 
Per the changelogs of Selenium2
 http://selenium.googlecode.com/svn/trunk/java/CHANGELOG
 Selenium2 does support Firefox 8.0.1
 
I have got it to work using Selenium 2.13 on a Mac using Firefox 8.0.1
 
The issue here is not related to the browser, but for the fact that the
 user is not able to spawn a grid itself.
 
If you go back and take a look at the original post, in the stack trace you
 will notice this
 
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to
 http://localhost:4444refused
 
Thanks & Regards
 Krishnan Mahadevan
 
"All the desirable things in life are either illegal, expensive, fattening
 or in love with someone else!"
 
On Fri, Dec 2, 2011 at 3:59 PM, Panchdev Chauhan <erpanch...@gmail.com>wrote:
 

- Show quoted text -

h k

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #12 on: April 01, 2012, 06:40:38 PM »
I'm using Firefox 3.6.24 on Windows XP.  Same connection refused using
 Selenium 2.13 and 2.14.  Any idea why connection was refused?
 Thanks,
 Henry
 
On Dec 2, 2:34 am, Krishnan Mahadevan
 

- Show quoted text -

h k

  • Web User
Re: Grid2 problem without SeleneseCommandExecutor
« Reply #13 on: April 01, 2012, 06:40:58 PM »
Found out Grid2 has problem in Windows XP SP3.  Bug filed is:
 http://code.google.com/p/selenium/issues/detail?id=3109
 OK in other OS'es like Windows XP SP2, Windows 7, Mac OS.
 
Henry
 
On Dec 2 2011, 8:35 am, h k <hhk0...@gmail.com> wrote:
 

- Show quoted text -

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
703 Views
Last post February 23, 2012, 07:38:39 PM
by Mike
1 Replies
630 Views
Last post February 23, 2012, 08:41:54 PM
by Sean Laurent
2 Replies
785 Views
Last post March 29, 2012, 07:50:55 PM
by Mike
3 Replies
530 Views
Last post April 02, 2012, 06:07:47 PM
by dtka
7 Replies
894 Views
Last post April 03, 2012, 02:03:53 PM
by Ian Simpson
17 Replies
1521 Views
Last post April 11, 2012, 02:02:10 PM
by Simon Stewart
Grid2

Started by semperos Selenium Webdriver Developers

4 Replies
446 Views
Last post April 12, 2012, 02:01:56 PM
by semperos

Review www.seleniumwebdriver.com on alexa.com