Selenium Grid issue

114 views
Skip to first unread message

ARK Satyanarayana Raju

unread,
Sep 10, 2014, 6:51:02 AM9/10/14
to seleniu...@googlegroups.com
HI,

I have started Hub and Node in VPN. In grid console status is displaying fine. but when i run my script it is throwing below error. i am using firefox 28 and selenium 2.40.0. I have tried with firefox 30 and 32 also but same issue.

Can any one suggest me.

Grid code:

                capability = new DesiredCapabilities();
                capability = DesiredCapabilities.firefox();
                capability.setBrowserName(DesiredCapabilities.firefox().getBrowserName());
                capability.setPlatform(Platform.WINDOWS);
                System.out.println("URL is: "+url);
                System.out.println("Browser type is: "+browserType);
                driver = new RemoteWebDriver(new URL("http://10.12.250.203:8080/wd/hub"), capability);
                driver.manage().window().maximize();
                System.out.println("Browser maximized");
                driver.get(url);
                System.out.println("URL is opened");
                driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


Console error:

[TestNG] Running:
  C:\Users\Edgar Green\AppData\Local\Temp\testng-eclipse-1824557591\testng-customsuite.xml

URL is: http://google.com/
Browser type is: ff
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.40.0', revision: 'fbe29a9', time: '2014-02-19 20:55:11'
System info: host: 'TSDB', ip: '10.12.250.248', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_45'
Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:567)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:218)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:113)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at grid_pack.FW.launchDriver(FW.java:155)
    at grid_pack.BAT_01.opneURL(BAT_01.java:13)
    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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:653)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    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:117)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:178)
    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
    at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:319)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:298)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:546)
    ... 31 more
FAILED CONFIGURATION: @BeforeMethod opneURL
java.lang.IllegalArgumentException: The Browser Type is Undefined
    at grid_pack.FW.launchDriver(FW.java:182)
    at grid_pack.BAT_01.opneURL(BAT_01.java:13)
    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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:653)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

SKIPPED CONFIGURATION: @AfterMethod tearDown
SKIPPED: getMethod

===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 1
    Configuration Failures: 1, Skips: 1
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1
===============================================

[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@1ded246d: 17 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@4136083b: 38 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@41785b00: 19 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@df077d2: 5 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 3 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@7f1d3cb1: 6 ms




Krishnan Mahadevan

unread,
Sep 10, 2014, 7:18:43 AM9/10/14
to Selenium Users
Can you please share the command that you are using to start the Grid and the node ?

Your exception is hinting on a "connection refused" which normally comes up when :

1. You are trying to connect to a port on which nothing is running [ mostly because your grid is not listening on 8080 port ]
2. Something in your machine is even blocking the port 8080 [ A firewall perhaps ? ]

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6fd0151b-2855-4f83-a81e-73baffc901db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

A R K Satyanarayana Raju

unread,
Sep 10, 2014, 7:47:50 AM9/10/14
to seleniu...@googlegroups.com
My Hub code is:
java -jar C:\Jar\selenium-server-standalone-2.40.0.jar -role hub -port 8080

Node code is:
java -jar C:\Jar\selenium-server-standalone-2.40.0.jar -role webdriver -hub http://10.12.250.248:8080/grid/register -browser "browserName=firefox, platform=WINDOWS, maxInstances=3" -port 5544

Inline image 1


For more options, visit https://groups.google.com/d/optout.



--
A R K Satyanarayana Raju

Krishnan Mahadevan

unread,
Sep 11, 2014, 9:10:13 AM9/11/14
to Selenium Users
Satya

Can you please try doing a get via curl command on the command prompt and tell us what you see ?


To learn how to get curl to work on windows please refer here : http://stackoverflow.com/questions/2710748/run-curl-commands-from-windows-console




Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

A R K Satyanarayana Raju

unread,
Sep 12, 2014, 5:07:08 AM9/12/14
to seleniu...@googlegroups.com
Hi Krishnan,

I got below message in browser when i use curl command.

{"port":"8080","servlets":[],"host":null,"throwOnCapabilityNotPresent":true,"cleanUpCycle":5000,"nodePolling":5000,"browserTimeout":0,"maxSession":5,"role":"hub","capabilityMatcher":"org.openqa.grid.internal.utils.DefaultCapabilityMatcher","newSessionWaitTimeout":-1,"success":true,"timeout":300000,"prioritizer":null}



For more options, visit https://groups.google.com/d/optout.

Krishnan Mahadevan

unread,
Sep 12, 2014, 8:29:41 AM9/12/14
to Selenium Users
Hmm.. now this is getting weird to be honest.. because that Curl command kind of confirms that there is no connectivity issues due to VPN... have you tried digging in and seeing whatelse could be wrong ?

Try setting up a break point at where you instantiate RemoteWebDriver and see if you can walk through the code to figure out where it is failing...

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Reply all
Reply to author
Forward
0 new messages