Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 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 Reply

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...