can't run scripts in IE or Chrome

311 views
Skip to first unread message

Tatyana

unread,
Jan 10, 2013, 7:04:40 PM1/10/13
to seleniu...@googlegroups.com
Hi, I noticed many people are facing the same problem while they try to run selenium scripts in a browser. My post might be redundant but i didn't find any solution so far. 
The issue I have is I want to run my script on browsers other than Firefox but for some reasons the script can't recognize  IE 8 or 9 or Chrome.
This is the error i get:  
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.24.1', revision: '17205', time: '2012-06-19 15:28:49'
      System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_33'
      Driver info: driver.version: RemoteWebDriver

The address i give is correct because Firefox runs totally fine.

This is a command line I used to register the node to the hub:

C:\Selenium>java -jar selenium-server-standalone-2.25.0.jar -role node -hub http://HUB.HOME.Instance4444/wd/hub -browser  browserName=iexplorer,version=9,platform=

WINDOWS

or

C:\Selenium>java -jar selenium-server-standalone-2.25.0.jar -role node -hub http://HUB.HOME.Instance:4444/wd/hub



This is a portion of the code where i specified details about environment: 

private WebDriver driver; 

private String baseUrl;

private StringBuffer verificationErrors = new StringBuffer();

public void setUp() throws Exception {

 

DesiredCapabilities capability = new DesiredCapabilities();

capability.setBrowserName("iexplorer");

driver = new RemoteWebDriver(new URL("http://16.NODE:5555/wd/hub"),capability);


Please help to find the problem is.
Thank you!

Anji Prassana

unread,
Jan 11, 2013, 12:27:43 AM1/11/13
to seleniu...@googlegroups.com
I hope, you run this command on the target machine i mean where the IE9 or IE8 browser exists...
C:\Selenium>java -jar selenium-server-standalone-2.25.0.jar -role node -hub http://HUB.HOME.Instance4444/wd/hub -browser  browserName=iexplorer,version=9,platform=
WINDOWS
 
If so, can you please provide us the console output whether the node is started and listenign to the hub or any exceptions.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/8eylVwbw0KIJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks&Regards
Anjaneyulu P
"The way you see the things is the way to think and is the way you react upon!!"

Tatyana

unread,
Jan 11, 2013, 1:02:12 AM1/11/13
to seleniu...@googlegroups.com, anji...@yahoo.co.in
Hi Anji,

I do run this command on the target Node machine where IE 9 exists. Here is an output I get which seems good to me but I could be missing smth. What puzzles me is why firefox always run but note other:

C:\Selenium>java -jar selenium-server-standalone-2.25.0.jar -role node -hub http
://HUB.HOME:4444/wd/hub -browser  browserName=iexplorer,version=9,platform=WINDOWS
Jan 10, 2013 9:55:44 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
adding browserName=iexplorer,version=9,platform=WINDOWS
Jan 10, 2013 9:55:45 PM org.openqa.grid.internal.utils.SelfRegisteringRemote startRemoteServer
WARNING: error getting the parameters from the hub. The node may end up with wrong timeouts.A JSONObject text must begin with '{' at character 1
21:55:45.242 INFO - Java: Sun Microsystems Inc. 17.0-b17
21:55:45.242 INFO - OS: Windows Server 2008 6.0 x86
21:55:45.246 INFO - v2.25.0, with Core v2.25.0. Built from revision 17482
21:55:45.342 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:5555/wd/hub
21:55:45.343 INFO - Version Jetty/5.1.x
21:55:45.343 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
21:55:45.344 INFO - Started HttpContext[/selenium-server,/selenium-server]
21:55:45.344 INFO - Started HttpContext[/,/]
21:55:45.346 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@166aa1
8
21:55:45.346 INFO - Started HttpContext[/wd,/wd]
21:55:45.349 INFO - Started SocketListener on 0.0.0.0:5555
21:55:45.349 INFO - Started org.openqa.jetty.jetty.Server@ab853b
21:55:45.350 INFO - using the json request : {"class":"org.openqa.grid.common.Re
gistrationRequest","capabilities":[{"platform":"WINDOWS","browserName":"iexplore
r","version":"9"}],"configuration":{"port":5555,"host":"16.103.227.3","hubHost":
"HUB.HOME","registerCycle":5000,"hub":"http://HUB.HOME:4444/wd/hub","u
rl":"http://NODE:5555","remoteHost":"http://NODE:5555","register
":true,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":
5,"browser":"browserName=iexplorer,version=9,platform=WINDOWS","role":"node","hu
bPort":4444}}
21:55:45.351 INFO - starting auto register thread. Will try to register every 50
00 ms.
21:55:45.352 INFO - Registering the node to hub :http://HUB.HOME:4444/grid/
register
21:55:50.577 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@
472d48 at URL: /status)
21:55:50.579 INFO - Done: /status


Thanks for your help!

Anji Prassana

unread,
Jan 11, 2013, 3:53:31 AM1/11/13
to seleniu...@googlegroups.com
Hi,
   while running your Script, Have you seen any error messages on the Grid Console?? Does your request reaches the Grid? If so, are you able to Connect with the target node?
 
Observe these while running your scripts. Also, if you register your node with Parameters like, Version and Platform, while creating the RemoteWebDriver instance, you should supply these as well in DesiredCapabilities please do all these...

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/dSYCNif0irQJ.

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

SeleniumUser

unread,
Jan 11, 2013, 6:25:42 AM1/11/13
to seleniu...@googlegroups.com
hi,

The solution of the problem is pass the chrome or explorer driver path in the command line like this

$ java -jar selenium-server-standalone-2.25.0.jar -role node -hub http://localhost:4444/grid/ register -port 5555 -Dwebdriver.chrome.driver=current/chromedriver.exe

Surely, it will work.

Thank You

Tatyana

unread,
Jan 14, 2013, 4:39:31 PM1/14/13
to seleniu...@googlegroups.com
Hi SeleniumUser,

Thanks for your suggestion. Your solution looks so right to me but i couldn't make it to work nonetheless. 
When i register a node is registered to a hub and I still see all defaults browser instances are present. However I made it work by modifying the code of test, yeahhh! (not sure if it's the best practice cause I'm still learning).
Now I'm looking into the next step how to make all browsers run at the same time. So far the only solution i get is to list all the browsers as I did it below but I'm afraid it will get the system slow when i have lots of tests. Do you have any suggestions?

                driver = new RemoteWebDriver(new URL("http://1.1.1.1:7777/wd/hub"),DesiredCapabilities.chrome());
driver = new RemoteWebDriver(new URL("http://1.1.1.1:7777/wd/hub"),DesiredCapabilities.firefox());
driver = new RemoteWebDriver(new URL("http://1.1.1.1:7777/wd/hub"),DesiredCapabilities.internetExplorer());


Thanks!

Tatyana

unread,
Jan 14, 2013, 4:42:14 PM1/14/13
to seleniu...@googlegroups.com, anji...@yahoo.co.in
Hi Anji,

I have made it work somehow. Looking for other alternatives. Thanks!
Reply all
Reply to author
Forward
0 new messages