-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
node-chrome with --headless rather than XVFB #429
Comments
Users don't browse in xvfb, what's your point? |
no, users use the physical browser. Xvfb allows the rendering of said physical browsers. |
Are you suggesting that chrome --headless behaves differently from chrome
under xvfb?
…On 12 Apr 2017 02:29, "Dj" ***@***.***> wrote:
no, users use the physical browser. Xvfb allows the rendering of said
physical browsers.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTMWyJFMfal-UsVak1INjMBFNCeS7ks5rvCkKgaJpZM4MusZ3>
.
|
PhantomJS' solo maintainer is leaving because of headless chrome. Can we reopen this discussion? (source: https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE) |
i guess i'm not familiar with chrome's headless mode.. tell me more, @graingert |
@ddavison you run It should massively simplify the default node-chrome. Also it's got a VNC like protocol over the chrome debug socket, so you wouldn't need node-chrome-debug either |
I think the biggest benefit that users find with the debug, is that you can VNC into it. You're saying that this could be eliminated? If that's the case, ok then. sign me up - apologies for the abrupt closing. An issue file with a very small description is dangerous as it leaves everything up to speculation :) I wasn't familiar with chrome --headless (hence why i asked you to elaborate) If this is possible, then yes.. we'll go this route. I'll keep this issue open and i'll mark as investigating. |
I think most automated testing will use chrome headless going forwards, and using docker for automated testing is a perfect fit, so this just seems like an obvious thing, in fact, iv been asking about it for the last few months and even tried to roll my own but chrome --headless was buggy. Big +1 from me on this as PhantomJS 2.5 release isn't even available and maybe we won't see it now that the maintainer has stepped down. The main reason is quite simple.... Chrome uses a lot of memory and cpu and that should be lower without Xvfb and real rendering. |
So, I just put in some time into this. XVFB will still be required for almost all projects, sadly (unless someone finds a workaround) In general it wasn't too rough to get running, but I get thrown the following when I try to use it for tests that have keyCode interactions (aka, any sendkeys stuff):
EDIT: Throwing XVFB in and using that to run the SE process (like normal), it all works properly, I'm just not sure that we're gaining much if we do that. I haven't poked around with this repo in ages. Do y'all have a standardish way of measuring performance? |
I guess the XVFB thing is a chromedriver requirement, so I opened a ticket here: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1772 If you wanna reproduce / help out with finding a fix, you can find steps to make an easy one-off container that runs selenium locally (without a hub/node configuration) in that issue. It's easy enough to convert those steps into the docker-selenium containers, but the send key stuff still exists. |
Indeed, I managed even to set the Chrome browser window size but once I removed Xvfb from docker-selenium I was also bitten by @SpencerMalone error:
|
I like the idea but please do not remove the current node-chrome and node-chrome-debug images when creating the headless images. I still like the idea of using real browsers inside containers. |
I think there won't be need to remove them, or even create a new image, you just need to pass some specific capabilities to Chrome, I think @elgalu showed them to me yesterday, can you share them? |
Correct, this works already:
|
Using the selenium node base image, I've found the following configuration works best:
Keeping the sandbox enabled caused an exception when selenium tried to start chrome. I put together an example app that extends the selenium node base image, installs latest snapshot of chromium (with headless bugfixes), and installs a recent build of chromedriver which allows chrome > 59. Unfortunately, I also discovered xvfb is required for |
Would be good to have a separate image node-chrome-headless to save space
on xvfb and deps
…On 22 Apr 2017 16:10, "Derek Kastner" ***@***.***> wrote:
Using the selenium node base image, I've found the following configuration
works best:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['headless','no-sandbox','disable-gpu','window-size=1920x1080']
}
}
Keeping the sandbox enabled caused an exception when selenium tried to
start chrome.
I put together an example app
<https://github.com/dkastner/headless-chromium-selenium> that extends the
selenium node base image, installs latest snapshot of chromium (with
headless bugfixes), and installs a recent build of chromedriver which
allows chrome > 59. Unfortunately, I also discovered xvfb is required for
sendKeys to work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTF5zuwN0IBMsL9Bq1m1B9eulvid5ks5ryhhOgaJpZM4MusZ3>
.
|
Awesome! This sounds like it requires half the resources of selenium/standalone-chrome (e.g. disk, RAM) |
yes, which would be super useful as we're hitting the resource limits on our aws instances using the standard selenium images. Headless should help there. |
@graingert, is it possible already to run Chrome headless without xvfb? |
Yes
…On 28 May 2017 18:31, "Diego Molina" ***@***.***> wrote:
@graingert <https://github.com/graingert>, is it possible already to run
Chrome headless without xvfb?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTGeJl_QBzx8dASjI8P2XPBjTHTWYks5r-a-CgaJpZM4MusZ3>
.
|
@graingert I was asking because if this #429 (comment) |
I would also like to know this. |
It was recently mentioned here:
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1772#c12 that you
might be able to use a different flag when chrome is compiled to fix the
sendkeys issue, but I've yet to try it.
…On May 29, 2017 9:53 PM, "Jorge Delgado" ***@***.***> wrote:
@diemol <https://github.com/diemol> @graingert
<https://github.com/graingert>
I would also like to know this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIYTQMj741-drZH33CdZiQHQH3DboI-jks5r-3aFgaJpZM4MusZ3>
.
|
I have found a workaround. It is simply to not use send key and instead use Javascript. Here is an example:
becomes:
There are multiple selectors for javascript you can use including name, id, class, etc. The above example is with python but it should work with all languages that allow javascript executions using selenium. This is an extremely frustrating issue as the majority of my tests required inputting text into some field. As a temporary workaround, I would suggest using this. |
I was also having this issue and can confirm simply updating chromedriver to 2.31 removed the need to use Xvfb |
Is people getting |
@cbrevik don't know if it's the solution but on centos 7 container I added |
Thanks for the suggestion @guillaumevincent! Ran |
I updated image to Chromedriver 2.31 and received errors like @cbrevik, |
I get the following exception if i run chrome headless
|
browser.serValue() causes the following error: Failed: unknown error: an X display is required for keycode conversions, consider using Xvfb This is a chromedriver's bug that is fixed in version 2.31. This commit is a workaround until the 2.31 will be released for Alpine Linux. ref. SeleniumHQ/docker-selenium#429
Even I am getting the above error. Does anyone know how to avoid this error? Following are chrome and chromedriver versions:
I am using 3.5.3 version of https://hub.docker.com/r/selenium/standalone-chrome-debug/tags/ |
+1 |
Hi, After reading all the thread again it looks like this should work already, right? Has someone achieved it and wants to send a PR? |
Does anyone know if this is the current status for headless? I checked around and I didn't find any more updates. If this stays like that, it wouldn't make so much sense to have headless as default. |
I believe it is going to stay that way, at least until https://bugs.chromium.org/p/chromium/issues/detail?id=617931 has some movement |
Looks like 617931 is fixed, but 775911 is marked as "WontFix" |
Have you got URLs for those tix?
…On 15 Feb 2018 19:45, "Tri Nguyen" ***@***.***> wrote:
Looks like 617931 is fixed, but 775911 is marked as "WontFix"
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTCYIUhH1SYUh02piQ_hwQTXzbkgzks5tVIk9gaJpZM4MusZ3>
.
|
I was referring to these 2 previous comments:
and
|
Hi all, We just made a change in the images and introduces the env var
If you do that, and check the running processes in the container, you'll see:
So
and for Chrome:
Therefore you can now run the images without Xvfb. I will comment again when the images with this change are released and pushed to Docker Hub. |
@diemol if I understand this correctly, I can use |
No, with Chrome you can pass video with the devtools protocol
…On Wed, 3 Oct 2018, 22:38 Tri Nguyen, ***@***.***> wrote:
@diemol <https://github.com/diemol> if I understand this correctly, I can
use headless, but in order to do debugging (with VNC), I would still need
xvfb?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTHvNL4kDKaQrSwBAV-2VWNhOlkdfks5uhS5IgaJpZM4MusZ3>
.
|
Is there any specific instruction for how I can do that (open and see the video feed)? |
… On Wed, 3 Oct 2018, 22:48 Tri Nguyen, ***@***.***> wrote:
Is there any specific instruction for how I can do that (open and see the
video feed)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTDHXLHAg9o-whjbCeNWlN85vJsdeks5uhTCSgaJpZM4MusZ3>
.
|
Run node-chrome with --headless rather than XVFB, to reduce resource usage.
The text was updated successfully, but these errors were encountered: