Chromedriver is extremely slow on a specific machine using Selenium Grid and .net
Asked Answered
G

4

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.

Glomerate answered 23/4, 2013 at 21:51 Comment(3)
Note: This issue exists whether I run the tests using MStest from within Visual Studio or whether I run them using the MStest command line. call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86_amd64 mstest /testcontainer:"PATH\Smoke Tests 4.dll"Glomerate
What do you see when you use chrome manually in the slow VMs? Are the pages loading as fast as other machines?Transpierce
Yes, when I run manually, it works at normal speed.Glomerate
I
34

I ran into a similar issue where chromedriver was slow in some machines and it turned out to be a proxy issue. Disabling "Automatically detect settings" under Chrome://settings >Change proxy settings> LAN Settings> made webdriver execute commands faster in chrome for me.

Intrigue answered 1/5, 2013 at 13:56 Comment(3)
Hi. I am using the latest version but "Change proxy settings" is located under "Network" and it is grey. Do you have any update? Thanks.Magazine
Is it possible do change this via capabilities or crome.switch parameter? I found something like --no-proxy-server, but that doesn't seem to work.Cerys
how to do it on ubuntu ?Skulduggery
C
9

My proxy settings were not using automatic detection, but I found the following helped a lot. The time it took to start the driver went down from 43 seconds to 1 second

driver = new ChromeDriver(new ChromeOptions{Proxy = null}); 
Crape answered 15/10, 2014 at 12:50 Comment(0)
S
0

Bug link in chromedriver issues This is long lasting issue that got lowest priority. But as more user will vote for it maybe someone will fix it. It could also be releated to Parsing of proxy configuration is not standard compliant which will be fixed soon.

Shanklin answered 29/8, 2018 at 10:41 Comment(0)
S
-1

This code solved the problem for me for Chrome 75 on macOS 10.14.3

ChromeOptions options = new ChromeOptions();
options.setProxy(null);
driver = new ChromeDriver(options);
Shahjahanpur answered 13/6, 2019 at 8:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.