I'm trying to set up geb functional testing in Grails, then I get "chrome failed to start". Could anyone help me out?
Exception Details:
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 9374
Only local connections are allowed.
Failure: |
unauthorized login to the home page(com.myapp.HomeFunctionalSpec)
|
geb.driver.DriverCreationException: failed to create driver from callback 'script1426780645607568441896$_run_closure1#b0894c'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:354)
at geb.Configuration.getDriver(Configuration.groovy:343)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.clearCookies(Browser.groovy:483)
at geb.Browser.clearCookiesQuietly(Browser.groovy:491)
at geb.spock.GebSpec.resetBrowser(GebSpec.groovy:45)
at geb.spock.GebSpec.cleanup(GebSpec.groovy:67)
Caused by: org.openqa.selenium.WebDriverException: unknown error: chrome failed to start
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 586 milliseconds
Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39'
System info: host: 'ILWS011', ip: '192.168.0.107', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:181)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:160)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:149)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:106)
at script1426780645607568441896.run_closure1(script1426780645607568441896.groovy:5)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 10 more
Below is the BuildConfig.groovy
def gebVersion = "0.9.2"
def seleniumVersion = "2.41.0"
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
....
test "org.apache.httpcomponents:httpcore:4.2.3"
test "org.gebish:geb-spock:$gebVersion"
test "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
test "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
}
plugins {
// plugins needed at test environment
test ":geb:$gebVersion"
}
test/functional/GebGonfig.groovy
import org.openqa.selenium.chrome.ChromeDriver
driver = {
System.setProperty("webdriver.chrome.driver", "C://chromedriver//chromedriver.exe")
new ChromeDriver()
}
I'm using the Chromedriver2.14, and putting it in C:/chromedriver/
Did I set everything right? Are the versions matching with each other?
It's maybe because of old selenium Version. Use 2.45 and the newest webdriver.
Related
I was using VirtualBox for development when i had a windows pc. Later i bought a Macbook M1 and installed the DDEV instead of VirtualBox.
In my old development virtualbox, i installed selenium and chromedriver in Virtualbox. With this setup i could run Codeception Tests.
Since i'm using DDEV for development, i tired to install Selenium-chromedriver with following tutorials:
https://dev.to/tomasnorre/codeception-ddev-selenium-docker-36kk
https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/Testing/ProjectTesting.html
My docker-compose.selenium.yaml File
version: '3.6'
services:
selenium:
container_name: ddev-${DDEV_SITENAME}-chrome
image: selenium/standalone-chrome:latest
environment:
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTP_EXPOSE=4444
external_links:
- ddev-router:$DDEV_HOSTNAME
codeception.yaml File
# suite config
suites:
acceptance:
actor: AcceptanceTester
path: .
modules:
enabled:
- WebDriver:
url: http://test.ddev.site
host: ddev-test-chrome
browser: chrome
- \Helper\Acceptance
I get following Error when i try to execute a Test in ddev ssh with php vendor/bin/codecept run tests/FirstCest.php
[Facebook\WebDriver\Exception\SessionNotCreatedException] Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: 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: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
Is it possible, that the errors are related to M1-Chip or am i doing something wrong?
The selenium/standalone-chrome image is not built for arm64 (Mac M1). In fact, the chrome package it probably derives from is not available at all for arm64.
However, the chromium package is available for arm64. You may be able to use justinribeiro/chrome-headless:chromium, which is built for arm64.
Also, take a look at https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/headless-chrome, which has been updated to use the arm64 chromium image.
This error message...
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
...implies that the ChromeDriver version wasn't detected.
Presumably the main issue is the incompatibility between the version of the binaries you are using.
Solution
Ensure that:
ChromeDriver is updated to current ChromeDriver v96.0 level.
Chrome is updated to current chrome=96.0.4664.45 (as per chrome=96.0.4664.45 release notes).
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).
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.
Basic outline of the problem:
I have a selenium web-driver test that is meant to perform a signup for a new customer on a website. In order to complete the signup process i need to enter credit card data. All payment information needs to be enter in to a payment gateway that's hosted within a iframe.
Now to my problem, when running my test locally it passes with out any problems. My web-driver test is able to locate all objects.
But when try to run it on our Jenkins build server we get an error saying that Jenkins cant find the iframe:
Caused by: org.openqa.selenium.NoSuchFrameException: Unable to locate frame: zuora-iframe
Build info: version: '2.43.0', revision: 'accb3003b9fb8f7cae30f9669b4c594a065396a6', time: '2014-09-09 22:22:51'
System info: host: 'JENKINS', ip: '192.168.0.112', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_20'
Driver info: driver.version: unknown
at .FirefoxDriver.prototype.switchToFrame(file:///C:/Windows/TEMP/anonymous4949736922419206681webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:9687:5)
at .DelayedCommand.prototype.executeInternal_/h(file:///C:/Windows/TEMP/anonymous4949736922419206681webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:11612:16)
at .fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Windows/TEMP/anonymous4949736922419206681webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:548:5)
Results :
Tests in error:
sigupTest(se.pp.home.seleniumtest.sigupTest): Unable to locate frame: zuora-iframe(..)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[ERROR] There are test failures.
In the test im using driver.switchTo().frame("zuora-iframe");to switch between the frames.
As per the instruction with http://ios-driver.github.io/ios-driver/?page=setup , i am trying to set up ios driver my application first testing using this automation.
I have installed java 7 and downloaded the app in given link. Installed OSX 10.9. While executing the command $ java -jar ios-server-0.6.6-SNAPSHOT-standalone.jar -aut path/to/aut.app -port 4444 i am getting below error
45:08:315 INFO ApplicationStore.<init> App archive folder:/Users/labuser/Downloads/applications
false
45:08:838 SEVERE IOSServer.main cannot start ios-driver server: org.openqa.selenium.WebDriverException: path/to/aut.app isn't an IOS app.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9', java.version: '1.7.0_55'
Driver info: driver.version: unknown
Any one suggest me to resolve this error and am new to use commands in terminal
It looks like path/to/aut.app is a placeholder and you need to replace it with the path to your application.