无法在多个Chrome实例上运行Selenium Grid 3.0.1

问题描述 投票:2回答:1

我最近从Selenium Grid 2.48迁移到了3.0.1但是我遇到了在多个Chrome实例上运行测试的问题。

看来,当Selenium Grid从v2更改为v3时,Chrome的默认浏览器实例从5变为1。在v2中,我在默认的五个Chrome实例上并行运行C#/ NUnit3测试没有问题。

但是,由于迁移到v3,每个节点不能运行多个线程。我可以使用maxInstances = 5启动节点,并可以在网格控制台中看到它们。网格控制台显示此消息“4个请求等待插槽空闲的请求”。即使有四个实例闲置。

我的网格配置如下:

java -jar selenium-server-standalone-3.0.1.jar -role hub -newSessionWaitTimeout -1 -maxSession 50 -browserTimeout 90  -timeout 100

节点

java -jar selenium-server-standalone-3.0.1.jar -port 5556 -role node -hub http://host:4444/grid/register  -browser browserName=chrome,maxInstances=5

如果我使用selenium-server-standalone-2.48.2.jar,一切都按预期工作,即使测试是使用v3 WebDriver和WebDriver.Support dll编写的。

c# google-chrome selenium selenium-grid nunit-3.0
1个回答
2
投票

您应该在节点上使用-maxSession参数,看看它是否有帮助。似乎在v3 maxSession上默认为1,这意味着你不能并行运行它,除非你在想要的数字上设置maxSession属性。

maxSession是一些可以并行运行的(任何)浏览器实例。

© www.soinside.com 2019 - 2024. All rights reserved.