Wednesday, January 18, 2017

Error message on selenium 3 with firefox

After updating the selenium driver to 3.0 i got few error messages and 1 was with the Gecko driver.
Then i add it to my project as on below and try to run the script.

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"E:\Users\\documents\visual studio 2012\Projects\TestWithSelenium3\TestWithSelenium3", "geckodriver.exe");

            //service.Port = 64444;
            //service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";

IWebDriver driver = new FirefoxDriver(service);

driver.Navigate().GoToUrl("http://www.google.com");

Then i got the below error which is little it different than the 1st error.(im not posting the 1st error because it was for the gecko driver.)

Test method TestWithSelenium3.CodedUITest1.CodedUITestMethod1 threw exception: 
System.InvalidOperationException: Unsupported Marionette protocol version 2, required 3
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxDriverService service)
   at TestWithSelenium3.CodedUITest1.CodedUITestMethod1() in e:\Users\cja\documents\visual studio 2012\Projects\TestWithSelenium3\TestWithSelenium3\CodedUITest1.cs:line 34

I tried so many things and had no luck,
So finally i checked my fire fox version and i was 44.XXXX..

Then i update the firefox to 47.0.2 and it works.
Cheers ...

No comments:

Post a Comment