使用 Selenium Grid 进行并行测试(使用 C# 单元测试)

发布于 2024-09-25 13:46:45 字数 525 浏览 2 评论 0原文

以下 AutomatedTesters 响应:有没有办法使用 C# 代码运行并行测试,而不使用 Selenium Core 以外的类库?


我有以下设置:

Selenium Grid Hub:192.168.0.1 硒RC 1:192.168.0.2 Selenium RC 2:192.168.0.3

两个遥控器都运行 *firefox。如果只有 1 个遥控器正在运行,当我向集线器发送测试时,它会加载并运行良好。但是,如果两个遥控器都在运行 - 测试仅在其中一个上运行。

我期待的是:-

selenium = new DefaultSelenium("192.168.0.1", 4444, "*firefox", "http://blah.com/");
selenium.Start();
// rest of test follows...

会同时启动两个遥控器吗?

有什么想法为什么不会发生这种情况吗?

非常感谢!

Following AutomatedTesters response: Is there any way to run parrallel tests with C# code, without using class libraries other than the Selenium Core?


I have the following setup:

Selenium Grid Hub: 192.168.0.1
Selenium RC 1 : 192.168.0.2
Selenium RC 2 : 192.168.0.3

Both remote controls are running *firefox. If only 1 of the remote controls is running, when I send a test to the hub it loads and runs fine. However if BOTH remote controls are running - the test only runs on one of them.

I was expecting that this:-

selenium = new DefaultSelenium("192.168.0.1", 4444, "*firefox", "http://blah.com/");
selenium.Start();
// rest of test follows...

would fire up BOTH remote controls at the same time?

Any ideas why this isn't happening?

Many thanks!

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

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

发布评论

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

评论(2

情绪操控生活 2024-10-02 13:46:45

不幸的是,这样做永远不会有 2 个 Selenium 实例运行。每个 Selenium 对象将控制一个浏览器,每个浏览器将从连接到 RC 的 1 个 RC 启动。

如果您想让它并行运行多个浏览器,您将需要使用类似 PNunitMBunits可并行化

Unfortunately doing that will never have 2 Selenium instances running. Each Selenium object will control a browser and each browser will be started from 1 RC connected to an RC.

If you want to have it running multiple browsers in parallel you will need to run your tests with something like PNunit or MBunits Parallelizable.

夕色琉璃 2024-10-02 13:46:45

我环顾四周,我认为对我来说答案是 Gallio ,它是测试运行程序

I've been having a look around and I think the answer for me is Gallio and it's test runners

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