"Access violation reading location" 在 IISExpress 10 中(在 webengine4.dll 中)与 Selenium IEDriver 12.6

"Access violation reading location" in IISExpress 10 (in webengine4.dll) with Selenium IEDriver 12.6

我的配置如下。 XUnit 运行ner (1.9.2) 触发使用 SpecFlow 生成的测试。 IISExpress 10 像这样在单例中启动:

_iisProcess = new Process { 
    StartInfo = { 
        FileName = Path.Combine(programFiles, @"IIS Express\iisexpress.exe") 
        } 
    }; 
var applicationPath = GetApplicationPath();
_iisProcess.StartInfo.Arguments = string.Format(
    "/path:{0} /port:{1} /systray:false /trace:e",
    applicationPath,
    IisPort); // so far 9090
_iisProcess.Start();

Selenium IEDriverServer.exe (2.46) 配置如下:

_driver = new InternetExplorerDriver(
    new InternetExplorerOptions(){EnsureCleanSession = true}); 

按照this guide配置的机器。 IEDriverServer.exe 监听 17923 端口。

在测试的某些时候,IISExpress 失败并出现 "Access violation" (c0000005) 错误。实际的失败系统测试各不相同,但看起来它是在有一些活跃的 UI 交互时发生的。有 SignalR、动态内容等。问题签名:

  Problem Event Name:   APPCRASH
  Application Name: iisexpress.exe
  Application Version:  10.0.10046.0
  Application Timestamp:    55121079
  Fault Module Name:    webengine4.dll
  Fault Module Version: 4.6.57.0
  Fault Module Timestamp:   551b8b21
  Exception Code:   c0000005
  Exception Offset: 00066ccf
  OS Version:   6.3.9600.2.0.0.256.48
  Locale ID:    1049
  Additional Information 1: 5861
  Additional Information 2: 5861822e1919d7c014bbb064c64908b2
  Additional Information 3: a10f
  Additional Information 4: a10ff7d2bb2516fdc753f9c34fc3b069

有时它会在 "OpenQA.Selenium.WebDriverTimeoutException : Timed out after 30 seconds" at DefaultWait.Until

这样的代码处失败
        IWait<IWebDriver> wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30.00));
        try
        {
            wait.Until(driver1 => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState").Equals("complete"));
        }
        catch (InvalidOperationException ex) // js error { /*...*/  }

IISExpress日志也无济于事。它只写一些最后的请求并终止:

Request started: "POST" http://localhost:9090/signalr/abort?transport=webSockets...
Request ended: http://localhost:9090/signalr/connect?transport=webSockets...  with HTTP status 101.0
Request ended: http://localhost:9090/signalr/abort?transport=webSockets&clientProtocol=1.4.... with HTTP status 200.0
WriteCompletedInline
Action = 00000002
Action = 00000000
Request ended: http://localhost:9090/signalr/connect?transport=webSockets....  with HTTP status 101.0
Request ended: http://localhost:9090/BotDetectCaptcha.ashx?get=image&c=SampleCaptcha&t=44c45e60afac46809bfce16e123b54a2 with HTTP status 200.0

在Administrator下测试运行也无济于事。当 R# test 运行ner 触发测试时也是如此。

如果您有任何想法,我们将不胜感激。谢谢!

以防有人帮助我通过重新安装 IIS Express 解决问题。 IIS Express 8.0 MSI 文件可在 here.

处找到