Selenium Grid 2 with Internet Explorer

896 views
Skip to first unread message

Mike

unread,
May 21, 2011, 8:21:03 PM5/21/11
to Selenium Users
I am downloading the trunk as of 22/05/2011 and building with 'go
release'. I'm then navigating to 'build\java\server\src\org\openqa\grid
\selenium' and launching a hub from there with the following command
line:
java -jar selenium-standalone.jar -role hub

Currently I am testing with a grid machine as the local one. So I run
another instance locally except this time of a webdriver which
connects to the hub I just launched:
java -Dwebdriver.chrome.driver="C:\Users\Mike\Desktop
\chromedriver.exe" -jar selenium-standalone-jar -role webdriver -port
12345 -hub http://localhost:4444/grid/register

Going to http://localhost:4444/grid/console in a browser, I can see
one WebDriverRemoteProxy supporting 5 concurrent tests from 5
firefoxs, 1 internet explorer and 1 chrome. I am using the following
code from an eclipse project:
public class Grabber {
public static void main(String[] args) throws MalformedURLException
{
RemoteWebDriver driver = new RemoteWebDriver( new URL("http://
localhost:4444/grid/driver"),
DesiredCapabilities.internetExplorer() );
driver.get("http://www.google.com");
driver.quit();
}
}

Having the DesiredCapabilities as Chrome or Firefox works perfectly.
Having it as Internet Explorer gives the following error:

Exception in thread "main" org.openqa.selenium.WebDriverException:
<html>
<head>
<title>Error 500 cannot find : {platform=WINDOWS,
ensureCleanSession=true, browserName=internet explorer, version=}</
title>
</head>
<body>
<h2>HTTP ERROR: 500</h2><pre>cannot find : {platform=WINDOWS,
ensureCleanSession=true, browserName=internet explorer, version=}</
pre>
<p>RequestURI=/grid/driver/session</p>
<p><i><small><a href="http://jetty.mortbay.org">Powered by
Jetty://</a></small></i></p>




















</body>
</html>

System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1',
java.version: '1.6.0_24'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
131)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
105)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
409)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:
103)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
86)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
94)
at Grabber.main(Grabber.java:9)

I also tried running the connecting webdriver as :
java -Dwebdriver.chrome.driver="C:\Users\Mike\Desktop
\chromedriver.exe" -jar selenium-standalone.jar -role webdriver -port
12345 -hub http://localhost:4444/grid/register -browser
browserName="internet explorer"

Going to the console I can see one internet explorer instance is
available. Running the eclipse code generates the same exception
however.

If it's relevant I am running on windows 7 and I have IE9 installed.
The following code works fine on the local machine:
public static void main(String[] args) throws MalformedURLException
{
WebDriver driver = new InternetExplorerDriver();
driver.get("http://www.google.com");
driver.quit();
}

Is there something I'm doing wrong or is this a known bug?

Brad

unread,
Jun 1, 2011, 8:38:05 PM6/1/11
to Selenium Users
Hi Mike,

I've noticed that by default, a remote webdriver client on Windows 7
registers Internet Explorer as platform=VISTA.

Either you'll need to specify this platform in your
DesiredCapabilities object, or, I'd recommend manually setting your
platform when you start your remote client. Something similar to:

java -jar "c:\se\selenium-standalone.jar" -role webdriver -port 5555 -
hub http://se-hub:4444/grid/register -browser "-browserName=internet
explorer,version=9,platform=windows"

Hope that helps,
-Brad



On May 21, 5:21 pm, Mike <michael...@hotmail.com> wrote:
> I am downloading the trunk as of 22/05/2011 and building with 'go
> release'. I'm then navigating to 'build\java\server\src\org\openqa\grid
> \selenium' and launching a hub from there with the following command
> line:
> java -jar selenium-standalone.jar -role hub
>
> Currently I am testing with a grid machine as the local one. So I run
> another instance locally except this time of a webdriver which
> connects to the hub I just launched:
> java -Dwebdriver.chrome.driver="C:\Users\Mike\Desktop
> \chromedriver.exe" -jar selenium-standalone-jar -role webdriver -port
> 12345 -hubhttp://localhost:4444/grid/register
>
> Going tohttp://localhost:4444/grid/consolein a browser, I can see
Reply all
Reply to author
Forward
0 new messages