Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

c# - Firefox crash when I run selenium unit test

I start use Selenium.WebDriver (v2.45) to run visual tests.

As web driver I use FirefoxDriver. I have installed Firefox 38. When I try run test firefox return exception with message:

FF has stopped working.

Does anyone have any suggestions? It worked in previous week, is it possible that my test was crashed by updated?

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: Firefox.exe
  Application Version:  38.0.1.5611
  Application Timestamp:    55540a1a
  Fault Module Name:    xul.dll
  Fault Module Version: 38.0.1.5611
  Fault Module Timestamp:   55541969
  Exception Code:   c0000005
  Exception Offset: 0035669b
  OS Version:   6.3.9600.2.0.0.16.7
  Locale ID:    1033
  Additional Information 1: 5861
  Additional Information 2: 5861822e1919d7c014bbb064c64908b2
  Additional Information 3: a10f
  Additional Information 4: a10ff7d2bb2516fdc753f9c34fc3b069

There is my test method body:

[Fact]
public void ShouldLoginForTestAccount()
{
    var driver = new FirefoxDriver();
    driver.Manage().Cookies.DeleteAllCookies();
    driver.Navigate().GoToUrl(LoginPage);

    driver.FindElementById("Login")
        .SendKeys("correctLogin");
    driver.FindElementById("Password")
        .SendKeys("correctPassword");

    driver.FindElementByTagName("button")
        .Click();

    Assert.Equal(TestingProjectUrl, driver.Url);

    driver.Close();
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Selenium 2.45 does not reliably work with Firefox 38 due to compatibility issues.

Downgrade Firefox to 35 (link to 35.0.1).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...