FireFox RemoteWebdriver error

609 views
Skip to first unread message

ipoh

unread,
Nov 15, 2012, 4:07:18 PM11/15/12
to webd...@googlegroups.com
I am using the following code to create remotewebdriver for firefox. It works when I am running the code on my desktop. However, when i try to run it on a different computer (by changing IPAddress in the code below) I get the error below:
{"Bad request\n\nCommand duration or timeout: 94 milliseconds\nBuild info: version: 'unknown', revision: 'unknown', time: 'unknown'\nSystem info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0_09'\nDriver info: driver.version: FirefoxDriver"}

                        DesiredCapabilities capability_FF = DesiredCapabilities.Firefox();
                        RemoteWebDriver RemoteFFDriver = new RemoteWebDriver(new Uri("http://" + IPAaddress + ":4444/wd/hub"), capability_FF);  // It errors out after executing this line of code
                        return RemoteFFDriver;

I have tried different versions of FireFox from 11 to 16 and also updated the selenium server to - selenium-server-standalone-2.26.0. It did not make a difference to the error. Currently, I am on Firefox 15. Any ideas what could be wrong here? RemoteWebDriver works for IE on the same computers though.

thanks,
Ipoh

Mike Riley

unread,
Nov 15, 2012, 6:34:43 PM11/15/12
to webd...@googlegroups.com
That looks fine to me.  Show us the error stack you get.

Mike

ipoh

unread,
Nov 15, 2012, 7:59:37 PM11/15/12
to webd...@googlegroups.com
Now I'm getting a couple of different error messages but similar Stack trace as listed below. Even IE is not working anymore. I have tried downloading a new copy of selenium-server-standalone-2.26.0. No changes made to the code.

Code for IE:

                        InternetExplorerOptions RemoteOptions = new InternetExplorerOptions();
                        RemoteOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
                        RemoteWebDriver RemoteIEDriver = new RemoteWebDriver(new Uri("http://" + IPAaddress + ":4444/wd/hub"), RemoteOptions.ToCapabilities());
                        return RemoteIEDriver;

IE:
Error Message - "The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list"

Stack trace - "   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 974\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 816\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 784\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 83\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 113\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 102\r\n   at ReusableTestLib.Reusable.getDriver(String BrowserType, String siteDomain, String IPAaddress) in C:\\DRX_TFS\\Internal\\QAEngineering\\ReusableTestLib\\ReusableTestLib\\Reusable.cs:line 283"


FireFox:

Message:  {"Bad request\n\nCommand duration or timeout: 46 milliseconds\nBuild info: version: 'unknown', revision: 'unknown', time: 'unknown'\nSystem info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.7.0_09'\nDriver info: driver.version: FirefoxDriver"} System.Exception {System.InvalidOperationException}


StackTrace "   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 974\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 816\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 784\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 83\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 113\r\n   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) in c:\\Projects\\WebDriver\\trunk\\dotnet\\src\\WebDriver\\Remote\\RemoteWebDriver.cs:line 102\r\n   at ReusableTestLib.Reusable.getDriver(String BrowserType, String siteDomain, String IPAaddress) in C:\\DRX_TFS\\Internal\\QAEngineering\\ReusableTestLib\\ReusableTestLib\\Reusable.cs:line 283"


On Thursday, November 15, 2012 1:07:18 PM UTC-8, ipoh wrote:

Mike Riley

unread,
Nov 16, 2012, 1:20:52 PM11/16/12
to webd...@googlegroups.com
I believe I recall Jim saying that with 2.26.0 you need to have InternetExplorerDriver for it to work with IE.  That is a separate download:
http://seleniumhq.org/download/
Or:
http://code.google.com/p/selenium/downloads/list

You need to be sure that the directory you place it in is in your PATH for the system.

I am wondering if you have the same issue here with Firefox, in that you don't have the Firefox binary in your PATH, because the stacks look almost the same.  For Firefox you can specify the location of the binary in the command line you use to start the remote server, or in the capabilities object you use to create the driver instance.  Personally, I prefer not to have code make that assumption, but to configure it for the system where the server is running.  That way the code runs no matter where the server is placed and can work for different OSes (Window, Linux/MacOS).

Mike

ipoh

unread,
Nov 16, 2012, 2:26:50 PM11/16/12
to webd...@googlegroups.com
I tried adding the path to IEDriverServer in the environment variable of my system. Still throwing the same error for IE. Do I need to specify the path anywhere else?

Apha

unread,
Nov 16, 2012, 3:04:33 PM11/16/12
to webd...@googlegroups.com
you have new RemoteWebDriver(new Uri("http://" + IPAaddress + ":4444/wd/hub"), capability_FF); instead of Uri try to use URL  and see how it goes .. I'm using selenium on remote host too it works fine for me 

hope that helps
A Pha

ipoh

unread,
Nov 19, 2012, 8:31:14 PM11/19/12
to webd...@googlegroups.com
Don't think we have URL as a type in C#.

Guys, any other suggestions on what could be wrong here. The remote IE driver throws an error right away. Remote FireFox throws an error after spawning a Firefox window. The error messages and stack traces are as mentioned above.

thanks,
ipoh

Alexandr Savchuk

unread,
Nov 19, 2012, 10:54:56 PM11/19/12
to webd...@googlegroups.com
About IE: 

you need to have in PATH folder at which IEDriverServer.exe is locatedbut not this exe itself.
Also if you uses grid then this exe should be located at all nodes.
And if you do not want to update PATH you can set -Dwebdriver.ie.path=<IEDrierServer.exe path> in commands which are used for hub and nodes 
starting.

About FF:

it's strange error. Looks like grid is incorrectly configured or worked inproperly.
Could you proide more information about grid configuration, how it is started, how it is used?
What is in hub/node logs?

ipoh

unread,
Nov 20, 2012, 1:40:35 PM11/20/12
to webd...@googlegroups.com
Thanks for your reply Alexandr. The attached doc has all the requested information. Let me know if you need anything else.
Webdriver errors.docx

Jim Evans

unread,
Nov 20, 2012, 3:23:35 PM11/20/12
to webd...@googlegroups.com
What happens if you copy the .jar to the local machine, and run it from the local hard drive rather than trying to use a UNC path? I honestly don't know what the JVM will do when running from a location not on the local machine.

ipoh

unread,
Nov 20, 2012, 4:25:55 PM11/20/12
to webd...@googlegroups.com
Thanks Jim. Having the .jar and the IE server on my own machine worked for me for both IE and FireFox. The issue you identified must have been causing it to fail. However, I still get the same errors even if i run the .jar and the IEServer on the remote m/c. Must be something wrong with the remote desktop then, i guess?

Thanks again,
Ipoh
Reply all
Reply to author
Forward
0 new messages