Chrome failed to start: exited abnormally - selenium

When I run an acceptance test on a remote linux server in Jenkins, the job fails
Facebook\WebDriver\Exception\SessionNotCreatedException] Unable to create new service: ChromeDriverService
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
Driver info: driver.version: unknown
I run the selenium server with the command
java -Dwebdriver.chrome.driver=./Codeception/chromedriver -jar ./Codeception/selenium-server-standalone-3.14.0.jar -port 17570 &
and run test
./composer.phar install
php codecept.phar run tests/acceptance/Jenkins_test_Cept.php --debug
Chrome version: 108.0.5359.124
Console log
+ java -Dwebdriver.chrome.driver=./Codeception/chromedriver -jar ./Codeception/selenium-
server-standalone-3.14.0.jar -port 17570
[workspace] $ /bin/sh -xe /tmp/***
+ cd Codeception/Brand_Analytics
+ ./composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Generating autoload files
+ php codecept.phar run tests/acceptance/Jenkins_test_Cept.php --debug
How I can solve this problem? I'm new in Jenkins and have no idea what to do

Related

This version of ChromeDriver has not been tested with Chrome version 79 error running protractorE2E tests with ChromeDriver Chrome Selenium

Those are my settings:
.gitlab-ci.yml
image: node
stages:
- test
tests:
stage: test
before_script:
# Add Google Chrome to aptitude's (package manager) sources
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list
# Fetch Chrome's PGP keys for secure installation
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# Update aptitude's package sources
- apt-get -qq update -y
# Install latest Chrome stable, Xvfb packages
- apt-get -qq install -y google-chrome-stable xvfb gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps default-jre
# Launch Xvfb
- Xvfb :0 -ac -screen 0 1024x768x24 &
# Export display for Chrome
- export DISPLAY=:99
# Install AngularJS CLI exclusively
# Add --unsafe-perm to resolve problems with node-gyp infinite loop on Docker
- npm install --silent --unsafe-perm -g #angular/cli#1.1.2
script:
- npm i --quiet
- npm run wd-update
- npm run wd-start &
- npm run start -- js-files/psh.conf.js
- npm run wd-shutdown
only:
- master
- merge_request
And this is the job outoput for tests
Running with gitlab-runner 12.3.0 (a8a019e0)
on runner-gitlab-runner-554cdd7fbc-4t8mw zxqBkdf4
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image node ...
Waiting for pod gitlab-managed-apps/runner-zxqbkdf4-project-62-concurrent-15jnmx to be running, status is Pending
Running on runner-zxqbkdf4-project-62-concurrent-15jnmx via runner-
$ npm i --quiet
> canvas#2.6.0 install /builds/automation/bender/node_modules/canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[canvas] Success: "/builds/automation/bender/node_modules/canvas/build/Release/canvas.node" is installed via remote
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 457 packages from 433 contributors and audited 1390 packages in 15.657s
found 0 vulnerabilities
$ npm run wd-update
> bender#1.0.0 wd-update /builds/automation/bender
> webdriver-manager update
[15:03:41] I/file_manager - creating folder /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/standalone-response.xml https://selenium-release.storage.googleapis.com/
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[15:03:41] I/config_source - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105.zip https://chromedriver.storage.googleapis.com/78.0.3904.70/chromedriver_linux64.zip
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
[15:03:42] I/update - chromedriver: unzipping chromedriver_78.0.3904.105.zip
[15:03:42] I/update - chromedriver: setting permissions to 0755 for /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105
[15:03:42] I/downloader - curl -o/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
[15:03:43] I/update - geckodriver: unzipping geckodriver-v0.26.0.tar.gz
[15:03:43] I/update - geckodriver: setting permissions to 0755 for /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0
$ npm run wd-start &
$ npm run start -- js-files/psh.conf.js
> bender#1.0.0 wd-start /builds/automation/bender
> webdriver-manager start
> bender#1.0.0 prestart /builds/automation/bender
> tsc && ts-cleaner -d js-files
[15:03:44] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.gecko.driver=/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0 -Dwebdriver.chrome.driver=/builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_78.0.3904.105 -jar /builds/automation/bender/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar -port 4444
[15:03:44] I/start - seleniumProcess.pid: 15684
15:03:45.253 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
15:03:45.506 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2019-12-17 15:03:45.713:INFO::main: Logging initialized #1029ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:03:46.441 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
15:03:46.780 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
> bender#1.0.0 start /builds/automation/bender
> node src/flake "js-files/psh.conf.js"
[15:03:52] I/launcher - Running 1 instances of WebDriver
[15:03:52] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
15:03:52.446 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "chrome",
"chromeOptions": {
"args": [
"--headless",
"--no-sandbox",
"--window-size=1550,768"
]
},
"count": 1,
"maxInstances": 1,
"shardTestFiles": false
}
15:03:52.449 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904#{#800}) on port 3722
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1576595032.499][SEVERE]: bind() failed: Cannot assign requested address (99)
[1576595033.109][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
15:03:53.266 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
15:03:53.323 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 26b7b655c1318cbcde9cfb69871f56ad (org.openqa.selenium.chrome.ChromeDriverService)
(node:15719) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Started
Jasmine started
2019-12-17T15:03:53.447Z - info: Current test running:
Psh site validations Site language should change
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.138+', java.version: '1.8.0_232'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.138+', java.version: '1.8.0_232'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15719) UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'runner-zxqbkdf4-project-62-concurrent-15jnmx', ip: '10.36.0.39', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.138+', java.version: '1.8.0_232'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/automation/bender/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
So, the error that I having is:
UnhandledPromiseRejectionWarning: WebDriverError: invalid session id
Any idea about this?
I was researching about two days at least and I didn't found anything related, I see a lot of errors but no one like this.
Should I use a docker image? instead install everything on the fly?
I couldn't find a docker image that match with my necessity.
Is the seleniumaddress that I'm using correct?
It's the one recommended by protractor site: seleniumAddress: 'http://localhost:4444/wd/hub'
This error message...
Starting ChromeDriver 78.0.3904.70
.
[1576595033.109][WARNING]: This version of ChromeDriver has not been tested with Chrome version 79.
.
15:03:53.323 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 26b7b655c1318cbcde9cfb69871f56ad (org.openqa.selenium.chrome.ChromeDriverService)
(node:15719) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
...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=78.0
Release Notes of chromedriver=78.0 clearly mentions the following :
Supports Chrome version 78
You are using chrome= 79.0
Release Notes of ChromeDriver v79.0 clearly mentions the following :
Supports Chrome version 79
So there is a clear mismatch between the ChromeDriver v78.0 and the Chrome Browser v79.0
Solution
Ensure that:
ChromeDriver is updated to current ChromeDriver v79.0 level.
Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Reference
You can find a relevant detailed discussion in:
How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
If you are using npm implementation of protractor type below command in cmd . Today by chrome version was changed to 79 and doing this solved my issue .
webdriver-manager update

Selenium with Firefox-ESR in Alpine Docker image

I'm using Selenium for testing from Java code, it's started automatically with maven, when I run mvn verify it uses gecko-driver to start new firefox instance for selenium:
final FirefoxOptions opts = new FirefoxOptions();
if (HEADLESS_MODE) {
opts.addArguments(ARG_HEADLESS);
}
return new FirefoxDriver(opts);
It's working fine on my machine (and on machines of other developers) in both modes "headless" and normal. Now I'm trying to run Selenium tests with CI builds in Alpine Linux Docker container. When I tried to run it as-is, I've got an error:
mozrunner::runner INFO Running command: "/usr/bin/firefox"
"-marionette" "--headless" "-foreground" "-no-remote"
"-profile" "/tmp/rust_mozprofile.pW1sbkcv98QN"
Error: GDK_BACKEND does not match available displays.
Then I installed all suggested tools (dbus and xvfb) from this post and started it before running tests:
apk add xvfb dbus
dbus-uuidgen > /etc/machine-id
export DISPLAY=:99
Xvfb $DISPLAY -ac &
mvn verify
but now Selenium tests are hadning for about 10 seconds and failing with error
1565433736375 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "--headless" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.1ZMsJ0Hy95V0"
1565433738424 Marionette INFO Listening on port 2828
!!! [Child][MessageChannel] Error: (msgtype=0x3E0003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv
[Child 2191] ###!!! ABORT: Aborting on channel error.: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.8.1esr/ipc/glue/MessageChannel.cpp, line 2152
[Child 2191] ###!!! ABORT: Aborting on channel error.: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.8.1esr/ipc/glue/MessageChannel.cpp, line 2152
!!! [Child][MessageChannel] Error: (msgtype=0x3E0003,name=PCompositable::Msg_Destroy) Channel error: cannot send/recv
It seems I'm doing something wrong here, what is the correct way to run headless Selenium tests in Alpine Linux Docker container? I'd prefer to configure existing Docker image instead of using Selenium images, because the migration will be expensive.
Update:
Selenium version is 3.141.59
Gecko-driver version is v0.24.0-linux64
Firefox-ESR version is: 52.8.1-r0
Update2:
xvfb, dbus and exported DISPLAY are not actually needed to run Firefox in headless mode - just run firefox --headless and it's all.
As per Mozilla --headless flag is not supported in Firefox 52-esr.Headless flag was introduced in version 55 (for Linux) and 56 (Mac/Windows) . Please try on latest Firefox ESR release.

selenium server standalone: unable to create a new session with vagrant in headless mode

I am trying to run the selenium server standalone in a vagrant box, with the following command:
java -jar selenium-server-standalone-3.13.0.jar
When I click the 'create session' button at http://lab.local:4444/wd/hub/static/resource/hub.html from my host web browser. I get a unable to create a new session error message.
I ask to create a firefox browser session for which I get the driver located in /usr/local/bin/geckodriver.
Firefox has been installed on the vagrant box with sudo apt install firefox-esr.
Error log detail:
14:52:04.485 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.13.0', revision: '2f0d292'
14:52:04.486 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-08-09 14:52:04.564:INFO::main: Logging initialized #312ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:52:04.757 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
14:52:15.563 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "firefox"
}
14:52:15.568 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
1533819135611 geckodriver INFO geckodriver 0.21.0
1533819135614 geckodriver INFO Listening on 127.0.0.1:25541
1533819135880 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.yuusnpGo8Gw6"
1533819136508 Marionette INFO Listening on port 2828
When I run the same executable directly from my host, I get no error and the firefox session is created with success.
I try to run a X server, Xvfb as follow but this does not change anything:
Xvfb :1 -screen 0 1600x1200x16 &
export DISPLAY=:1
java -jar selenium-server-standalone-3.13.0.jar
Problem solved after switching to selenium-server-standalone-3.3.1.jar with geckodriver 0.14.0. Sessions are created with success with this configuration.
source.

Codeception - Can't connect to Webdriver (Acceptance Test)

I can access url and create sessions:
http://localhost:4444/wd/hub/static/resource/hub.html
but when i execute ./codecept run i get an error, but i have Selenium Server running:
[ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.
To execute Selenium Server, i used this command:
java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar"
I tried too with IE and Chrome (i have the same problem too):
java -Dwebdriver.chrome.driver=./chromedriver -jar "selenium-server-standalone-3.12.0.jar"
java -Dwebdriver.ie.driver=./IEDriverServer -jar "selenium-server-standalone-3.12.0.jar"
acceptance.suite.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
- \Helper\Acceptance
config:
WebDriver:
url: 'http://localhost'
browser: firefox
window_size: 820x1000
Codeception Version: 2.4.1
WebDriver Chrome Version: 2.38 (win32)
WebDriver Firefox Version: 0.20.1 (x64)
Chrome Version: 66.0.3359.139 (64-bit)
Firefox Version: Firefox Quantum 60.0 (64-bit)
Windows Version: Windows 8.1 64bit
Selenium Version: 3.12.0
To start Selenium Server you need not require to pass/specify the WebDriver variant and you can start the Selenium Server as follows :
Command :
>java -jar selenium-server-standalone-3.12.0.jar
Console Logs :
C:\Utility\selenium-server-standalone>java -jar selenium-server-standalone-3.12.0.jar
15:28:28.249 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'
15:28:28.251 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-05-11 15:28:28.361:INFO::main: Logging initialized #467ms to org.seleniumhq.jetty9.util.log.StdErrLog
15:28:28.860 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
Snapshot of the Resource Hub :
Update
As per the documentation at codeception.com the acceptance.suite.yml should have been as follows :
modules:
enabled:
- WebDriver:
url: 'http://localhost/'
browser: firefox
window_size: 820x1000
Problem fixed. I was using proxy.
For future users with same problem like me, can follow the steps.
First, check if you have proxy defined with this command:
echo %http_proxy%
If return some result, you need set a empty proxy with this command:
set http_proxy=
You need define a proxy always you are opening a new command line.

Protractor with Visual Studio Team Services - "Could not find chrome binary"

I've been trying to setup Protractor on Visual Studio Team Services and currently I'm having a build run a .bat file to start my protractor test.
When the build runs, it gives me an error message saying Could not find Chrome binary, and gives me a file location that doesn't exist on my directory.
Error trace-back:
2017-05-25T20:43:49.3521640Z ##[section]Starting: Run script protractor.bat
2017-05-25T20:43:49.3521640Z
===========================================================================
2017-05-25T20:43:49.3521640Z Task : Batch Script
2017-05-25T20:43:49.3521640Z Description : Run a windows cmd or bat script and optionally allow it to change the environment
2017-05-25T20:43:49.3521640Z Version : 1.1.3
2017-05-25T20:43:49.3521640Z Author : Microsoft Corporation
2017-05-25T20:43:49.3521640Z Help : [More Information]
(https://go.microsoft.com/fwlink/?LinkID=613733)
2017-05-25T20:43:49.3521640Z
============================================================================
2017-05-25T20:43:49.3601629Z ##[command]d:\a\1\s\protractor.bat
2017-05-25T20:43:49.3761643Z
2017-05-25T20:43:49.3761643Z d:\a\1\s>cd .\e2e
2017-05-25T20:43:49.3761643Z
2017-05-25T20:43:49.3761643Z d:\a\1\s\E2E>protractor conf.js
2017-05-25T20:43:50.8302366Z [20:43:50] I/direct - Using ChromeDriver directly...
2017-05-25T20:43:50.8342360Z [20:43:50] I/launcher - Running 1 instances of WebDriver
2017-05-25T20:43:50.8342360Z [20:43:50] E/direct - Error code: 135
2017-05-25T20:43:50.8342360Z [20:43:50] E/direct - Error message: Could not find chromedriver at C:\NPM\Modules\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.25.exe
2017-05-25T20:43:50.8342360Z [20:43:50] E/direct - Error: Could not find chromedriver at C:\NPM\Modules\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.25.exe
2017-05-25T20:43:50.8342360Z at Direct.getNewDriver (C:\NPM\Modules\node_modules\protractor\built\driverProviders\direct.js:65:27)
2017-05-25T20:43:50.8342360Z at Runner.createBrowser (C:\NPM\Modules\node_modules\protractor\built\runner.js:197:43)
2017-05-25T20:43:50.8342360Z at C:\NPM\Modules\node_modules\protractor\built\runner.js:276:30
2017-05-25T20:43:50.8342360Z at _fulfilled (C:\NPM\Modules\node_modules\protractor\node_modules\q\q.js:834:54)
2017-05-25T20:43:50.8342360Z at self.promiseDispatch.done (C:\NPM\Modules\node_modules\protractor\node_modules\q\q.js:863:30)
2017-05-25T20:43:50.8342360Z at Promise.promise.promiseDispatch (C:\NPM\Modules\node_modules\protractor\node_modules\q\q.js:796:13)
2017-05-25T20:43:50.8342360Z at C:\NPM\Modules\node_modules\protractor\node_modules\q\q.js:556:49
2017-05-25T20:43:50.8342360Z at runSingle (C:\NPM\Modules\node_modules\protractor\node_modules\q\q.js:137:13)
2017-05-25T20:43:50.8342360Z at flush (C:\NPM\Modules\node_modules\protractor\node_modules\q\q.js:125:13)
2017-05-25T20:43:50.8342360Z at _combinedTickCallback (internal/process/next_tick.js:67:7)
2017-05-25T20:43:50.8342360Z [20:43:50] E/launcher - Process exited with error code 135
2017-05-25T20:43:50.8552361Z ##[error]Process completed with exit code 135.
2017-05-25T20:43:50.8582364Z ##[section]Finishing: Run script protractor.bat
When I install Chromedriver on the build it installs it to a different file location:
d:\a\1\s\node_modules\chromedriver\lib\chromedriver\chromedriver.exe
The test runs fine locally but doesn't work when I commit it to VSTS.
Is there anyway to make it so that chromedriver is installed in a different file location, or have Selenium look in a different place for chromedriver?
Thanks
Put the relative path to the ChromeDriver executable in conf.js. This is well-documented.
Use webdriver-manager package that comes with protractor - it can download any version of any binary that you want - https://www.npmjs.com/package/webdriver-manager
So it ends up with running webdriver-manager update before starting protractor tests (just make sure that if you are running locally installed protractor - you also update using locally installed webdriver-manager)
First, based on the log, you are using Hosted Build agent that running as service, but the test need to be interact with UI, so you can’t to do Protractor test with Chrome on Hosted Build agent.
You can refer to this way to set up a private build agent on your machine: Deploy an agent on Windows
Secondly, you can refer to these steps to install chromedriver:
Add Npm task (npm command: install; arguments: -g protractor)
Add Command Line task (Tool: webdriver-manager; Arguments: update --versions.chrome 2.25)