visual-studio-2008 - 在 VSTestHost 下运行 WatiN 测试的线程问题

标签 visual-studio-2008 testing tfs watin vstesthost

我已经在我的开发环境中运行了一个简单的 WatiN 网络测试,并试图让它在 TFS 构建服务器上运行。 WatiN 正在触发异常:

System.Threading.ThreadStateException: The CurrentThread needs to have it's 
ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer.

测试运行器 VSTestHost 应该默认使用 STA 线程。我还尝试通过 .testrunco​​nfig 文件明确强制它进入 STA。 WatiN还是不高兴。 我在 Windows Server 2008 上使用 Visual Studio/TFS 2008。

有没有其他人遇到过这个问题并找到了解决方案?

最佳答案

您可能想检查/使用 WatiN 测试方法的 [STAThread] 属性

关于visual-studio-2008 - 在 VSTestHost 下运行 WatiN 测试的线程问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/927064/

相关文章:

windows - windows下如何像静态库一样发布代码

javascript - 需要帮助在 Protractor 中使用 for 循环和 getText()

internet-explorer - 不同操作系统版本下的相同浏览器行为

c# - TFS 2010-从 checkin 任务中获取文件的特定版本

visual-studio-2008 - Visual Studio 9解决方案中的项目数量是否会影响解决方案的负载和生成时间?

c++ - 对在用于实时 IIS 7.0 事件记录的 Visual C++ 代码中使用 'HANDLE' 感到困惑

visual-studio - Visual Studio 08拼写检查插件?

ruby-on-rails - 如何为事件记录范围编写测试?

tfs - 从全局列表中清除历史构建

c# - 如何通过 C# 从 tfs 获取所有工作项