【发布时间】:2016-08-16 06:29:07
【问题描述】:
我正在使用 nightwatch 并行运行测试。我希望能够在不同的硒进程中一次运行多个测试。我怎样才能做到这一点?
我所做的是创建一个 selenium 集线器:
java -jar /opt/selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver=/usr/bin/chromedriver -Dwebdriver.chrome.bin=/usr/bin/google-chrome -log /home/jenkins-user/log/selenium.log -role hub &
当每个测试运行时,我都会创建一个节点:
java -jar /opt/selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver=/usr/bin/chromedriver -Dwebdriver.chrome.bin=/usr/bin/google-chrome -log /home/jenkins-user/log/selenium.log -role node -browser browserName=chrome -hub http://localhost:4444/grid/register &
不幸的是,这使我无法并行运行守夜测试。
我做错了什么?
【问题讨论】:
-
好吧,您没有使用可用的本机并行支持(而是尝试在构成 Nightwatch 的“正常”并行测试范围之外做一些事情)。如果对每个运行的测试使用单个 selenium 会话,并且每个 CPU 分发测试 (nightwatchjs.org/getingstarted#basic-settings),那么每个 CPU 的每个测试将有一个 selenium 会话。这不是你想要的吗?