-
-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headless Chrome slows tests by 10x #561
Comments
headless
option to Chrome wdio slows tests by 10x
@fatso83 Did you try with node < 8 such as 7.10.0? |
Tried with Node 7.4.0. Still a lot slower. A test run took 26 seconds with the non-headless browser and 1m5s with |
Thanks, I will investigate this issue |
I reproduced the issue but I still have no clue what's wrong. |
I see the same slowness with and without --dissable-gpu so thats not the case. When i connect to the headless i see SO MANY ssl warning and so on - i think its just due to that. |
Thanks. Maybe this could be the case |
Hey. Is there any updates on this issue? We've ran into similar problem on some of our machines. Our tests just timeout because of the enormous time it takes for headless chrome to do what we ask. And if launched not in headless it runs smooth. We ran into this problem on windows 7. With latest chromedriver 2.33 and latest chrome. But it's very random. On other machines with the same configuration it runs perfectly in headless (well, not exactly perfectly, but only ~1.5x times slower). Perhaps you have an idea what should we check on these machines? to pin point the mystical difference between them. |
Also experiencing extremely slow load times when using Chrome in headless mode in Windows 7 with the latest version of Chromedriver, Chrome, and Selenium. Interestingly I'm not having any issues on Windows 10. |
I'm coming at this from a different place, but interestingly there's an open issue on ChromeDriver which sounds suspiciously related: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2054&q=jenkins&colspec=ID%20Status%20Pri%20Owner%20Summary |
I'm in the same boat as @emesterhazy . I currently have Chrome Version 63.0.3239.132 and ChromeDriver 2.35 on Windows 7 and headless hangs up on retrieving the sites. When I come home from work, I'll mess around with this on my Debian 9 and Windows 10 machine and report the results. Simple test of retrieving the Facebook home page and grabbing login forms:
Also, I have Google Chrome Canary downloaded, but I haven't attempted to configure the driver to use it. Not sure if using Canary over standard Chrome would make a difference. |
Try these two ChromeOptions:
I dunno in wich forum it was but this did the trick for me |
@oligee80 THANK YOU SO MUCH! |
@oligee80 Thanks much!!! It worked for me as well. |
@oligee80 Really thank you buddy, I have been breaking my head for that issue, finally got worked out |
I am trying this on win 10. After adding the arguments that @oligee80 has mentioned, I do not see any difference. Is there something else that I should be doing? |
@krrahulmanikanta Is your Chrome version compatible? |
@Resh5 Yes, I am using chromedriver v2.38 and my chrome is of v66 |
@krrahulmanikanta It workes fine for me . But I am in Windows7 |
I'm seeing a similar issue using Puppeteer and Chromium (no WebDriver), the proxy arguments do not seem to make a difference in my case. This may be an issue related to Chromium. macOS: 10.13.4 |
And decrease single test timeout, optimistically. See codeceptjs/CodeceptJS#561 (comment)
And decrease single test timeout, optimistically. See codeceptjs/CodeceptJS#561 (comment)
@oligee80 Thanks |
Don't know if you'll actually see this, but it seems like the following solved the issue for me: options.addArguments("--proxy-server="); |
I am having a similar issue on this one still. I tried with the following arguments
I am still not seeing any speed up. 40 seconds to run in headless and 4 seconds to run in windowed mode. I am running ChromeDriver 75.0.3770.140. Please let me know if anyone solves this one! Could really help me out. All I am doing is calling |
Ok so after looking into it a bit more it seems that avoiding using headless chrome is the solution for me. Instead I use the pyvirtualdisplay library and set its visibilty to false. This sped up my performance 10x. Here is the code:
with output:
instead of:
|
Was searching for solution to a similar problem so I'm adding a note for reference: Running a test scenario with headless Chromium and 100 instances. Machine is an AMD 2950X with 16 phys cores @4 GHz, 128 GB RAM and an Nvidia GTX 1660 GPU on Windows 10. This machine turns into a sluggish mess when running this with GPU-disabled in chromium startup. With GPU enabled, response is acceptable. With 200 clients, machine goes very sluggish (useless) again even with GPU. With 200 instances, GPU utilization is very low (<10%) and CPU is ~35% It seems to be some windows resource causing degradation because when doing a remote login session with another account while the load is running, the new session has no problems with response. So it looks like Windows and not the hardware is the bottleneck. Contemplating trying with Windows server to see if that helps. Update: Windows server 2019 made no difference Running headless instances in tabs instead seems to stress the system a lot less. We can now run 4 - 5 times as many instances with less problems compared to 200 instances before. |
I saw some people get this to work and others do not have any success with it:
I did not have success at first ether, then I looked at my code and realized that I have called setChromeOptions() more than one time and wondered if options are getting over-written. I moved things around to make only one call to
You can ignore the lines dealing with hiding images, windows size etc. if you choose. |
in my case, add the following argument solve my problem |
Where do you insert this? |
Find this fix at codeceptjs/CodeceptJS#561
Only thing that worked for me is adding UserAgent to the options: |
What are you trying to achieve?
I am trying to run my tests in headless Chrome using the
--headless
argument. I expect the tests to run in approximately the same amount of time as the usual runs, as running a clean webdriverio script runs faster headless than in a normal browser window.What do you get instead?
The tests run about ten times as slow, using 44 seconds instead of 4 seconds.
verbose output from headless run
verbose output from normal (non-headless) run
Test source code
Details
This is my configuration:
The text was updated successfully, but these errors were encountered: