【发布时间】:2013-07-05 14:38:48
【问题描述】:
我正在通过 Visual Studio 调试 Selenium 测试套件。我希望抛出/捕获的异常能够中断,以便找出缺少的内容,但我是 C#/Visual Studio 的新手,不知道该选择什么。
一个示例异常块:
The thread '<No Name>' (0x75ac) has exited with code 0 (0x0).
A first chance exception of type 'OpenQA.Selenium.NoSuchElementException' occurred in WebDriver.dll
A first chance exception of type 'OpenQA.Selenium.NoSuchElementException' occurred in Selenium.WebDriverBackedSelenium.dll
A first chance exception of type 'Selenium.SeleniumException' occurred in Selenium.WebDriverBackedSelenium.dll
The thread '<No Name>' (0x7250) has exited with code 0 (0x0).
我应该选择什么让它在那些第一次机会异常时停止,以便我可以修复代码?
谢谢!
【问题讨论】:
-
您是在 MsUnit 中使用 build 还是在 NUnit 之类的其他东西中使用?
-
我们使用 NUnit 和 .NET Selenium WebDriver 构建。
-
在这种情况下,您需要将 Visual Studio 调试器附加到 NUnit 进程。在 Visual Studio 菜单中,转到 Debug -> Attach to process... 并选择 nunit
标签: c# selenium exception-handling