28

Overview: Chromedriver works normally on one machine but extremely slowly on two other identical machines.

Setup:

  • Selenium Webdriver using .Net for coding and Selenium Grid for distributing the tests. MSTest is being used from within Visual Studio 2010 in order to run the tests.
  • A 64bit Windows 7 local machine acting as the Hub
  • Three 32-bit Win 7 remote machines (two of them are virtual) on my local network all configured as nodes. Here is the command used to start the nodes on the remote machines:

    java -jar c:\seleniumWebDriver\seleniumGrid\selenium-server-standalone-2.31.0.jar -role node -hub http://XXX.XXX.XXX.XXX:4444/grid/register -browser "browserName=chrome",maxInstances=4 -Dwebdriver.chrome.driver="C:\seleniumWebDriver\chromedriver.exe"

  • The driver is launched like this from within the code:

    DesiredCapabilities capability = new DesiredCapabilities(); capability.SetCapability(CapabilityType.BrowserName, browser); driver = new RemoteWebDriver(new Uri(hubUrl), capability);

  • The variable "browser" and "hubUrl" above is passed via an app.config file that is built at runtime. For this case, browser=chrome.

Problem:

  • When I setup machine 212 (which is a virtual machine) as a chrome node using the command above, and then launch the scripts from the hub, I see chrome start in the proper remote machine and run normally. It fields between 5-10 commands per second.

  • When I setup either machine 78 (virtual machine) or machine 103 (real machine) as a node in the same manner, and then launch the scripts from the hub, I see the node start up chrome properly. However, it runs extremely slowly, like 1 command per sec or less.

Other info: Like I said, on one machine chrome works normally, but on the others, runs extremely slowly. Firefox and IE, when configured as nodes, work normally.

I have compared the machine 212 (which works properly) with the other machines and cannot find the difference. All the machines are using 'selenium-server-standalone-2.31.0.jar' and the same version of the ChromeDriver.

It does not appear that the node machines are being overloaded. Also, it is a very consistent difference in performance which does not seem related to any fluctuating load on the network or the machines.

My network tech has verified that all these machines are configured identically on the network.

Has anybody seen anything like this before?

EDIT 1: I logged in today and all three remote machines are running chrome slowly. Before one of them was normal, but now they are all slow.

4

4 回答 4

34

我遇到了类似的问题,chromedriver 在某些机器上运行缓慢,结果证明是代理问题。在 Chrome://settings >Change proxy settings> LAN Settings> 下禁用“自动检测设置”使 webdriver 在 Chrome 中为我更快地执行命令。

于 2013-05-01T13:56:36.517 回答
9

我的代理设置没有使用自动检测,但我发现以下内容有很大帮助。启动驱动程序所需的时间从 43 秒下降到 1 秒

driver = new ChromeDriver(new ChromeOptions{Proxy = null}); 
于 2014-10-15T12:50:07.600 回答
0

chromedriver 问题中的错误链接这是优先级最低的长期问题。但随着更多用户投票支持它,也许有人会修复它。它也可能与代理配置的解析不符合标准有关,这将很快得到修复。

于 2018-08-29T10:41:31.410 回答
-1

此代码为我解决了 macOS 10.14.3 上 Chrome 75 的问题

ChromeOptions options = new ChromeOptions();
options.setProxy(null);
driver = new ChromeDriver(options);
于 2019-06-13T08:35:23.853 回答