Hi i'm running a test using galen framework on my local machine and it runs successfully but when it runs on jenkins I get the following error:
> galen test ./test/test-e2e/ui_galen/tests/HomePage.test.js --htmlreport reports -Dwebdriver.chrome.driver=./test/test-e2e/bin/drivers/linux/chromedriver
========================================
Test: valida la home page de identity validation on desktop emulation en 1024 device
========================================
Jan 23, 2018 11:16:35 AM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 32254
Only local connections are allowed.
org.mozilla.javascript.WrappedException: Wrapped org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881),platform=Linux 4.4.0-1022-aws x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.06 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: '82965b46ff8c', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-1022-aws', java.version: '1.8.0_151'
Driver info: driver.version: ChromeDriver (<cmd>#37)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen._cmd__18._c_createDriver_2(<cmd>:37)
at org.mozilla.javascript.gen._cmd__18.call(<cmd>)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen._app___test_test_e2e_ui_galen_tests_______ui_galen_config_devices_js_25._c_anonymous_16(/app/./test/test-e2e/ui_galen/tests/../../ui_galen/config/devices.js:116)
at org.mozilla.javascript.gen._app___test_test_e2e_ui_galen_tests_______ui_galen_config_devices_js_25.call(/app/./test/test-e2e/ui_galen/tests/../../ui_galen/config/devices.js)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at org.mozilla.javascript.gen._app___test_test_e2e_ui_galen_tests_______ui_galen_config_galen_config_js_23._c_openDriverForDevice_6(/app/./test/test-e2e/ui_galen/tests/../../ui_galen/config/galen_config.js:58)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
I have installed Xvfb on jenkins. Is there an extra configuration for Galen to run on jenkins?
Here is the Xvfb config I have:
echo $'\nInitializing X virtual framebuffer (Jenkins only) ...'
export DISPLAY=:0
Xvfb :0 -screen 0 1024x768x8 &> /dev/null &
After that is that I run the npm run e2e-galen:ci command.
did yo started Xvfb before running the Galen commands?
e.g.
Xvfb :99 &
export DISPLAY=:99
Related
while trying to run slenium tests from docker which we use in most projects i get this error saying chrome has crashed i 've both google chrome and chrome driver installed and working fine any help with this ?
(node:231) UnhandledPromiseRejectionWarning: WebDriverError: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '1a84fd607b36', ip: '172.27.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.47-linuxkit', java.version: '1.8.0_292'
Driver info: driver.version: unknown
remote stacktrace: #0 0x00400068e949 <unknown>
This error message...
(node:231) UnhandledPromiseRejectionWarning: WebDriverError: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '1a84fd607b36', ip: '172.27.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.47-linuxkit', java.version: '1.8.0_292'
Driver info: driver.version: unknown
remote stacktrace: #0 0x00400068e949 <unknown>
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as java.version: '1.8.0_292' and the error being:
Driver info: driver.version: unknown
remote stacktrace: #0 0x00400068e949 <unknown>
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u311.
Selenium is upgraded to current levels Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v95.0 level.
Chrome is updated to current Chrome Version 95.0 level. (as per ChromeDriver v95.0 release notes).
Starting ChromeDriver 89.0.4389.90 (62eb262cdaae9ef819aadd778193781455ec7a49-refs/branch-heads/4389#{#1534}) on port 30551
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[ERROR] Tests run: 4, Failures: 2, Errors: 0, Skipped: 2, Time elapsed: 149.547 s <<< FAILURE! - in TestSuite
[ERROR] BrowserSelection(Cucumberoption.HomepageRunner) Time elapsed: 149.258 s <<< FAILURE!
org.openqa.selenium.WebDriverException:
unknown error: DevToolsActivePort file doesn't exist
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'ip-172-31-49-149', ip: '172.31.49.149', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-1041-aws', java.version: '11.0.10'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x562952783379
Make sure your Chrome browser version is compatible with your ChromeDriver version. Your ChromeDriver is 89.0.4389.90, so Chrome Browser version on your Jenkins agents should be 89 as well.
Type your command here, but i think it occurs because you forgot to specify to run browser in headless mode
On my Mac, I built image with FROM selenium/standalone-chrome-debug:3.4.0-chromium in Dockerfile.
When I run my app in the container, I got:
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.19.76-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'a45e0250acbf', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver
Image built in Jenkins with same Dockerfile run same application, it has no issue. Both chromedriver=2.29.461571.
I have setup remote debug and want to debug on my macos before I push to Jenkins/linux, but blocked by this chrome failed to start: exited abnormally in container on macos.
Why this happens on my macos but not in Jenkins/Linux and how to fix it?
This error message...
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.19.76-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'a45e0250acbf', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.29
Release Notes of chromedriver=2.29 clearly mentions the following :
Supports Chrome v56-58
Presumably you are using the latest chrome=85.0
Release Notes of ChromeDriver v85.0 clearly mentions the following :
Supports Chrome version 85
So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v85.0
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u252.
Selenium is upgraded to current released Version 3.141.59.
ChromeDriver is updated to current ChromeDriver v85.0 level.
Chrome is updated to current Chrome Version 85.0 level. (as per ChromeDriver v85.0 release notes)
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Take a System Reboot.
Execute your #Test as non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Scenario:
Running tests from docker container, in docker container.
Results:
Tests fail with below errors:
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
T E S T S
Running org.hobsoft.docker.mavenchrome.BrowserTest
Starting ChromeDriver 84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147#{#310}) on port 16079
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1594905471.000][SEVERE]: bind() failed: Cannot assign requested address (99)
ChromeDriver was started successfully.
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.28 sec <<< FAILURE! - in org.hobsoft.docker.mavenchrome.BrowserTest
canDuck(org.hobsoft.docker.mavenchrome.BrowserTest) Time elapsed: 1.274 sec <<< ERROR!
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '3cf859c01b07', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_252'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x55bb64b8aea9
Root cause: Cause lays in trying to launch a browser in the container.
Fix: Launch selenium in headless mode in your tests.
For Java, this is shown as below.
ChromeOptions options = new ChromeOptions().setHeadless(true);
WebDriver driver = new ChromeDriver(options);
Results: Now tests run successfully, without any errors.
Error in SDK:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -s ce0616068209b10805 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 26.70 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-1M92PA5', ip: '10.250.2.20', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:156)
at Appium.AppiumSetupPage.setUp(AppiumSetupPage.java:43)
at Appium.C8_Java.main(C8_Java.java:10)
Error in Appium Server:
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"C:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -s ce0616068209b10805 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n)","killed":false,"code":1,"signal":null,"cmd":"C:\WINDOWS\system32\cmd.exe /s /c \"C:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -s ce0616068209b10805 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk\"\"","origValue":"Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"C:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -s ce0616068209b10805 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 26099.816 ms - 1420
This is the known issue with Android N (Android 7.0)
you need to either re-install the server (with the --no-shrinkwrap flag) or go into your Appium installation and run the following npm install command.
npm install appium-adb#2.6.13 --no-shrinkwrap