Chrome Sometimes Fails To Open On Jenkins Server RobotFramework Tests - google-chrome

Our Robotframework test suites run every night against our websites. For the last few weeks there have been very random failures at the start of some tests with the following error just as the headless chrome browser goes to open:
(chrome not reachable)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
It is never the same test and seems to happen randomly. In each set of tests, the browser will open, do some tests, then close. This will happen multiple times in a test file. The test suites could sometimes go for days without any issue and then suddenly it will start happening again. I have tired adding some chrome options as suggested from other posts, but the issue still remains. I have also checked and confirmed the server is never under any pressure.
The browser opens will the following code.
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
${user_agent} set variable --user-agent=Test User
${sandbox} set variable --no-sandbox
${shm-usage} set variable --disable-dev-shm-usage
Call Method ${options} add_argument ${user_agent}
Call Method ${options} add_argument ${sandbox}
Call Method ${options} add_argument ${shm-usage}
open browser about:blank headlesschrome options=${options}
Set Window Size 1440 1080
It is on the second last line where it goes to open browser where it sometimes randomly fails with the error.

I suggest you to change schedule time 2-3 hours forward or backward and then monitor if job fails or not. I assume you are getting this error because Jenkins is starting other jobs at the same time and there are no enough resources to run Chrome.

Related

Cypress Runner Blocked by An Extension

I have been trying to get Cypress to run tests for about a week now, but I simply can't get past this chrome error talking about an extension blocking the cypress runner (if I run it in other browsers it also fails, although the other browsers simply time out and don't mention an extension - even so I'm not convinced it's a chrome issue). It loads the page fine but breaks on the first action, in this case clicking a login button from a portal.
I have tried restarting computer, reinstalling chrome, reinstalling cypress, reinstalling dotnet, re-cloning my entire repo containing cypress (3 times at least), and clearing web data (10 times at least). Other articles online have mentioned setting chromeWebSecurity = false in cypress.json but that has been the default for me since the beginning and this issue persists.
Thanks in advance for any help with this!

Keep Chrome running in headless mode

I want to use Chrome browser in headless mode to produce images (PNG, JPEG) out of SVG graphic. Code works in normal interactive mode, but I have problems to use it in headless mode.
My main problem is that headless Chrome exits before drawing of HTML page is completed. As I understand, if I start Chrome with following arguments:
chromium --headless http://myserver.org
It exits together with document.onload event. But at this moment not all data fetched from the server (I using XMLHttpRequest) and therefore drawing is not complete.
I found workaround if I start chrome with debugging port enabled like:
chromium --headless --remote-debugging-port=7777 http://myserver.org
But this is not that I want, especially when I do not have privileges to open http ports on the node. Is there possibility to let Chrome running longer with other flags? I check a lot of them, but did not found appropriate one. Or is there any other methods to postpone exit of the headless Chrome?
You could try this answer https://stackoverflow.com/a/46424041/4830701
Copy pasted here for reference
Use the binary /opt/google/chrome/chrome directly not google-chrome which points to bash script /usr/bin/google-chrome.
Taken from comments in
https://developers.google.com/web/updates/2017/04/headless-chrome#screenshots

Cannot start Protractor tests with Chrome

Yesterday everything was working fine for me. It broke just by itself. When I try to run an automated test with protractor, it runs Google Chrome, but over it appear a blank console. and nothing behind it loads. The URL behind it stays "data;". If I close that blank console, it opens by itself again. If I set the browser at the config file to be Firefox, it runs without any problem.
This bug appeared after the chrome update for many people, the solution that worked for me and other people in SO is reinstall protractor.
Did you try running webdriver-manager update to update the selenium and chrome drivers?

How to enable chrome crash dump collection during automated testing?

I know how to enable chrome's crash reporting interactively:
Menu > Settings > Show advanced settings > Tick "Automatically send usage statistics and crash reports to Google"
However, I'm using chrome in an automated testing setup where we set a new --user-data-dir for each run (so there are no persisted settings, we just get the defaults). Chrome is crashing occasionally (running our javascript/html application) and I would like to be able to report these crashes.
I thought I could add --enable-crash-reporter (according to the List of Chromium Command Line Switches), but that doesn't seem to do anything. (We already pass --enable-logging and a couple other flags on the command line.)
I have a test that triggered an "Aw, Snap":
But if I download the user-data-dir for that run and and point chrome at it, and then visit chrome://crashes, it says crash dumps are not enabled.
(The chrome_debug.log does not say anything about the Aw-Snap either.)
We're running chrome under Xvfb on Debian. We're driving chrome via the direct webdriver (from Protractor).
According to the "crashpad with content shell" docs, the steps for using crashpad with content shell (a stripped down version of Chrome):
Create some directory for your crash dumps to go to (the docs suggest tmp/crashes on Linux and Mac, %TEMP%\crashes on Windows, and /data/local/tmp/crashes on Android)
Start Chrome with --enable-crash-reporter --crash-dumps-dir=<your_dump_dir> (looks like you got half of this)
So I'd try adding the --crash-dumps-dir flag.

Google chrome failed to parse extension manifest

After upgrading Google chrome from 34 version to 35 it doesn't work.
I use debian testing. As soon as I run
google-chrome
from console I get an error:
"Error...: failed to parse extension manifest" after that I get login screen.
I've tried to reinstall the browser, cleaned chrome's cache and config folders. But result the same.
Also I can't get detail log. I tried to run google chrome from console like:
google-chrome > log.txt
but I got empty log.txt file.
Also I checked /var/log/... files. But I didn't find anything interesting.
It would be great if someone tells me how I can get detailed log information or how to fix this issue:)
Try
chrome 2> log.txt
Same here. But I not even get to any screen. Crashes right away after an update (there was a new Chromium AND also kernel update coming following each other a few days apart. Because I didn't start Chromium in between I cannot even tell what could cause this.
I also assume that ""Error...: failed to parse extension manifest"" here is a side effect of something more severe. I get more errors like:
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[7351:7351:0614/212426:ERROR:sandbox_linux.cc(297)] InitializeSandbox() called with multiple threads in process gpu-process