在 Visual Studio 中运行测试时尝试使用 MSTest 启动 selenium

发布于 2024-08-12 08:34:12 字数 557 浏览 1 评论 0原文

我正在尝试使用 MSTest 在 Visual Studio 中运行 selenium Web 测试。 我有一个 selenium 进程类、一个 selenium 运行程序类和一个 Web 开发测试类,如本文中所示: http://keithbloom.wordpress.com /2009/10/16/running-selenium-tests-in-visual-studio/

我打开命令提示符,并且在调试时可以看到 selenium 启动消息。然而,当我第一次调用 selenium.Open 时,一切都会关闭。 MSTest 错误是引用未设置到对象的实例吗?

当我尝试使用 Resharper(使用 MSTest)运行它时,显然所有路径都是错误的:( 由于某种原因,Resharper 需要大约 2 分钟才能开始测试,而 MSTest 需要 5 秒?

有人知道如何让这些工具真正协同工作吗?

I'm trying to run selenium web tests in Visual Studio using MSTest.
I have a selenium process class, a selenium runner class and a web dev test class, as in this article:
http://keithbloom.wordpress.com/2009/10/16/running-selenium-tests-in-visual-studio/

I get the command prompt opening and I can see the selenium startup messages when I debug. However the first time I call selenium.Open everything shuts down. The MSTest error is reference not set to instance of an object?

And when I try and run it with Resharper (using MSTest), obviously all the paths are wrong :(
And for some reason Resharper takes about 2 mins to start the test where as MSTest takes 5s?

Anyone have any idea how to get these tools to actually work together?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自此以后,行同陌路 2024-08-19 08:34:12

我经常将 Selenium 与 C# 和 NUnit 结合使用。我不使用 MSTest 进行测试,但它们往往运行得很快。

我不久前整理了一个 C#/NUnit/Selenium 教程。本教程的 URL 为 http://www.theautomatedtester.co.uk/seleniumtraining/ selenium_csharp_nunit.htm。我从未尝试过使用 Resharper 或 MSTest 运行它,但它应该可以正常工作。只需将方法属性更改为相关的 MSTest 项即可。

I use Selenium with C# and NUnit quite regularly. I don't use MSTest for my tests but they tend to run quite quickly.

I have put together a C#/NUnit/Selenium tutorial a while ago. The URL for the Tutorial is http://www.theautomatedtester.co.uk/seleniumtraining/selenium_csharp_nunit.htm. I have never tried to run it with Resharper or MSTest but it should work fine. Just need to change the method attributes to the relevant MSTest items.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文