No instrumentation runner found on device emulator-5556 for package my.project.android.debug - android-instrumentation

I am trying to run Detox test on the emulator. When I run "detox test --configuration android.emu.debug -l verbose" it throwing error message as
"No instrumentation runner found on device emulator-5556 for package
my.project.android.debug
at ADB.getInstrumentationRunner
(../node_modules/detox/src/devices/android/ADB.js:219:54)"
Note : apk is getting install in the emulator but it is not launching the app.
Version details :
Detox : v8.0.0
node : v8.11.3
npm : 5.6.0
react-native-cli: 2.0.1
react-native: 0.53.3
Just to update more,
When I run adb shell pm list instrumentation I could not find my app instrumentation. However, the application is already installed in the emulator.

After you build your Android app you'll be able to find it in the next path: android/app/build/outputs/apk/debug/app-debug.apk
Also, when the app is built you'll be able to find a folder androidTest in the next path: android/app/build/outputs/apk/androidTest/app-debug-androidTest.apk. You should install that file on the device and after that you'll be able to run the test.

Appreciating that this is a rather old question. However I was having this same error while trying to run Detox test locally and it took me a while to figure out a solution for me - Googling this error doesn't bring up much help.
Anyway, this is how I resolved this particular error..
Change this code in the e2e/init.js file: (as set up by the detox init command)
beforeAll(async () => {
await detox.init(config, { reuse: true })
})
to this...
beforeAll(async () => {
await detox.init(config)
})
This for me resolved the issue of
Error: No instrumentation runner found on device emulator-5554 for package com.

Related

React-native running app error while gradle

I'm new to react-native and i went trough making my first app, and all good until i got to run it because i get this error, i would ¡be thankful if someone could help me, i did all the tutorial that react-native provide in it's page so i think i installed it correctly.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 870 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
/bin/sh: adb: command not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/fovu/Documents/AwesomeProject/android/local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/fovu/Documents/AwesomeProject/android/local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
at makeError (/Users/fovu/Documents/AwesomeProject/node_modules/execa/index.js:174:9)
at /Users/fovu/Documents/AwesomeProject/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/fovu/Documents/AwesomeProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/fovu/Documents/AwesomeProject/node_modules/#react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
Hello and welcome to StackOverflow!
As the logs mention, it cannot compile you app since the location of your android SDK cannot be found.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/fovu/Documents/AwesomeProject/android/local.properties'.
It seems that your properties file points to a wrong SDK directory, your ANDROID_SDK_ROOT path points to a wrong directory or the ANDROID_SDK_ROOT path doesn't exist at all.
I'd recommend you to read through the official setup documentation and following each step: https://reactnative.dev/docs/environment-setup
Appendix
I have seen in your logs that react-native doesn't even see an emulator, hence this line:
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
So you need to either manually launch an emulator or if you don't have an android emulator, install one. Or if you want: You can try to install the app on your phone by plugging it into your computer and enable USB debugging on your phone.
Cheers.

Deploy error An unexpected error occurred: "ESOCKETTIMEDOUT". App Service Azure

I have a big problem trying to deploy a react app to a azure app service with visual studio azure app service extension, im getting this error
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.27.tgz: ESOCKETTIMEDOUT".
Im using yarn and i read that increase the network timeout maybe solve this. But how i can do it?
I am using yarn and i read that increase the network timeout maybe
solve this. But how i can do it?
You can try running it in your terminal :
$ yarn install --network-timeout 1000000
And also try to clear the cache by running the below cmd
$ yarn cache clean
$ yarn // to install dependencies, no need for "yarn install"
Please refer the below links for more information:
.yarn is having troubles with the network connection | SO THREAD .
. React deployment keeps failing with ESOCKETTIMEDOUT | MS Q&A
Try to NOT run build on Azure. Do this by answering NO when you publish.
Have you already made the settings to build on Azure (answered yes) .. undo by deleting the following files
.vscode\settings.json
.deployment
Create the file .yarnrc, and write into file:
network-timeout 1000000
Save file & deploy your app with the file

Unable to run the first time react-native app for android on mac

I'm trying to run the react-native application on the macbook for android version.So I have followed all the step for setting up the environment on the machine from here :
https://facebook.github.io/react-native/docs/getting-started.html
And I have successfully install Android Studio,Android SDK, JDK, Node, NPM, Watchman, Homebrew
javac -version : 9
node -v : v8.9.1
npm -v: 5.5.1
watchman version: 4.9.0
When I tried to run the application with the command
react-native run-android
I got this error :
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/Users/aman/.gradle/wrapper/dists/gradle-2.14.1-all/8bnwg5hd3w55iofp58khbp6yv/gradle-2.14.1/lib/gradle-base-services-2.14.1.jar) to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> javax/xml/bind/annotation/XmlSchema
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 9.925 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
According to this GitHub issue, this issue has to do with JDK version. Make sure you're using v8, not v9, then the error should not occur.
Yes, according to #Sam Hanley it's an issue with the java version update. So, with worrying about the version update/downgrade, we can pass on with this issue by the following process;
First, update the distributionUrl in gradle-wrapper.properties
ie: located in this path;
PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip
Set $JAVA_HOME environment variable using the installed android studio app path (Android studio should be installed)
export JAVA_HOME="/Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home"
(PS: solution for macOS )
Hope this help!
I was able to get past this particular problem by doing the following:
Edit path_to_your_project/android/gradlew
Change DEFAULT_JVM_OPTS="" to DEFAULT_JVM_OPTS="--add-modules java.se.ee"

"Runtime.executionContextCreated has invalid 'context" error when i run Protractor

I am getting this below Error while i run my protractor. And below is the error as shown in my webstorm console.
"C:\Program Files (x86)\JetBrains\WebStorm 2016.2\bin\runnerw.exe"
"C:\Program Files\nodejs\node.exe"
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\cli.js
C:\Users\x216526\workspace_Protractor\SWA_Protractor\conf.js
[17:59:58] I/direct - Using ChromeDriver directly... [17:59:58]
I/launcher - Running 1 instances of WebDriver [18:00:01] E/launcher -
session not created exception from unknown error:
Runtime.executionContextCreated has invalid 'context':
{"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2824.0) (Driver info:
chromedriver=2.22.397933
(1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT
6.1.7601 SP1 x86_64) [18:00:01] E/launcher - SessionNotCreatedError: session not created exception from unknown error:
Runtime.executionContextCreated has invalid 'context':
{"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2824.0) (Driver info:
chromedriver=2.22.397933
(1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT
6.1.7601 SP1 x86_64) at WebDriverError (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:26:26)
at SessionNotCreatedError
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:307:26)
at Object.checkLegacyResponse
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:639:15)
at parseHttpResponse
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:538:13)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:472:11
at ManagedPromise.invokeCallback_
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2820:25
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
From: Task: WebDriver.createSession() at Function.createSession
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Driver
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:778:38)
at Direct.getNewDriver
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\direct.js:68:26)
at Runner.createBrowser
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\runner.js:187:43)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\runner.js:261:30
at _fulfilled
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at
c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle
(c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
[18:00:01] E/launcher - "process.on('uncaughtException'" error, see
launcher [18:00:01] E/launcher - Process exited with error code 199
Process finished with exit code 199
My config js look like below:
exports.config = {
directConnect: true, // Capabilities to be passed
//to the webdriver instance.
capabilities: { 'browserName': 'chrome', },
framework: 'jasmine2',
specs: ['./src/sli_sanitytests/San1_Check_
Sli_Homepage_is_Accessible_spec.js',
'./src/sli_sanitytests/San2_
Click_createButton_to_Open_Sli_CreateForm_page_spec.js',
'./src/sli_sanitytests/San3_
Create_Sli_reference_spec.js' ],
suites: {
smoke: ['./smoke/!*.spec.js'],
regression:['./regression/!*.spec.js'],
functional: ['./functional/!*.spec.js'],
all: ['./!*!/!*.spec.js'],
selected:['./functional/addcustomer.spec.js',
'./regression/openaccount.spec.js'],
},
// Options to be passed to Jasmine
jasmineNodeOpts: {
//onComplete will be called just before the driver quits.
onComplete: null,
// If true, display spec names.
isVerbose: true, // If true,print colors to the terminal.
showColors: true, // If true, include stack traces in
//failures.
includeStackTrace: true, // Default time to wait in ms
//before a test fails.
defaultTimeoutInterval: 80000
},
//enter code here
onPrepare:function() {
browser.ignoreSynchronization = true;
browser.driver.manage().window().maximize();
},
}
2016-10-13: ChromeDriver v2.24 has been released which supports Chrome v52-54. (Thanks #Anton)
2016-08-16: One of the recent updates to the Chrome Dev channel introduced a bug preventing ChromeDriver from properly starting. Having just worked around the same problem, I would suggest backing up your data and reverting to the Beta or Stable release channel of Chrome. See the Chrome Release Channels for more details on safely switching.
Alternatively, switching to the Dev version of ChromeDriver should also fix the issue. From a closed issue on the chromedriver project:
There are some Devtool changes in Chrome dev channel v54 which is not currently supported in Chromedriver stable v2.23.
You may want to use dev version of Chromedriver which has the fix. It can be downloaded from chromedriver…/continuous/….zip
Review the issue for the full link.
If the latest protractor is not having the latest chromedriver then to update it using webdriver-manager follow these below steps
enter latest chromedriver version in file config.json this file is present under path /node_modules/protractor/node_modules/webdriver-manager/built
optional (and change 'mac32' to 'mac64' in file 'chrome_driver.js' which is present under path /webdriver-manager/built/lib/binaries)
run webdriver-manager update in the console.
hint: To get the path of 'webdriver-manager' folder observe the console after command webdriver-manager update
Since I got the same issue and found this question, I'd like to add a bit more context: it is indeed a version problem between an 'old' chrome driver (2.22 in my case) and a 'newer' chrome release (54 in my case) like Sean answered.
However there is no need to fiddle manually with config files or downloads.
Instead just run
npm update protractor -g
To update protractor globally then
webdriver-manager update
To update the chrome driver. The newer chrome driver v2.25 is not yet included in the protractor package at the time of writing (you will get v2.24 instead) but it works fine with Chrome 54. Protractor is v4.09 at the time of writing. The same trick should work for future versions too!
After big battle with above issue i have found the solution for it. So please
don`t do anything.
First of all uninstall your chrome browser and reinstall it. That`s it protractor will not throw any such errors.
I even don`t know why this happened and for what reasons looks bit strange but yes the only solution is uninstall the chrome browser and reinstall it.
npm uninstall webdriver-manager -g
npm install webdriver-manager -g
I have the same problem with 2.24 version. In order to fix this bug download chromedriver.exe with version 2.25, it's available now by link https://sites.google.com/a/chromium.org/chromedriver/downloads
Try to reinstall webdriver-manager
npm uninstall webdriver-manager -g
npm install webdriver-manager -g
Issue was fixed for me after I installed webdriver-manager: 10.2.8
This is common issue, I faced it many times.
I use chromedriver in my selenium framework once in month and I usually get this type of error.
Follow below steps:
Unistall/Remove all existing chromedriver.
Install latest
chromedriver from official google site.
Set system path to chromedriver.exe folder (So you don't need to bother about setting the system path from code)
Restart the IDE (If already running)
ENJOY !
I updated to Chrome Driver 2.25 which fixed the problem for me. This is a simple update:
Download the latest version from: https://sites.google.com/a/chromium.org/chromedriver/downloads
Unzip the contents (it's one file "chromedriver.exe").
Copy that over your existing chromedriver.exe
For me that was at: \node_modules\protractor\selenium
That's it. I reran the tests and the pesky error went away.
First of all uninstall your chrome browser and reinstall it. That`s it protractor will not throw any such errors.
I even don`t know why this happened and for what reasons looks bit strange but yes the only solution is uninstall the chrome browser and reinstall it.
npm uninstall webdriver-manager -g npm install webdriver-manager -g

Unable to run Protractor - ECONNREFUSED connect ECONNREFUSED

I'm trying to learn AngularJS. As part of this, I want to learn to use end-to-end testing. Currently, I have a directory structure like this:
node_modules
.bin
...
protractor
...
node_modules
.bin
adam-zip
glob
minijasminenode
optimist
saucelabs
selenium-webdriver
protractor
config.js
src
tests
test.e2e.js
My config.js file looks like the following:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
specs: [
'../src/tests/test.e2e.js'
],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
test.e2e.js looks like the following:
'use strict';
describe('My Sample', function () {
driver = protractor.getInstance();
beforeEach(function () {
driver.get('#/');
});
it('My First Test', function () {
message = "Hello.";
expect(message).toEqual('World.');
});
});
When I attempt to run my end-to-end tests using protractor, I run the following command from the command-line:
node_modules\.bin\protractor protractor\config.js
When I run that command, I receive the following error:
C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1542
throw error;
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:12
7:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1528:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriv
er\lib\webdriver\webdriver.js:130:49)
at Function.webdriver.WebDriver.createSession (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver
\lib\webdriver\webdriver.js:110:30)
at Builder.build (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver\builder.js:105:20)
at runJasmineTests (C:\Src\MyProject\node_modules\protractor\lib\runner.js:191:45)
at C:\Src\MyProject\node_modules\protractor\lib\runner.js:255:5
at C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1178:15
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriv
er\lib\webdriver\promise.js:1438:20)
at notify (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:328:12)
at then (C:\Src\MyProject\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:377:7)
What am I doing wrong?
I solved this with --standalone flag:
webdriver-manager start --standalone
I got it working by removing the following line from my config.js
seleniumAddress: 'http://localhost:4444/wd/hub',
Are you running a selenium server? The git README states the following:
WebdriverJS does not natively include the selenium server - you must start a standalone selenium server. All you need is the latest selenium-server-standalone.
source: https://github.com/angular/protractor
The error message is due to the following:
[ECONNREFUSED] The attempt to connect was ignored (because the target is not listening for connections) or explicitly rejected.
Check the URL of the Webdriver manager. The default URL is:
http://localhost:4444/wd/hub
Use a background process to run the webdriver-manager, then run protractor:
Start-Process webdriver-manager start -passthru
protractor conf.js
This will start up a Selenium Server and will output a bunch of info logs. Your Protractor test will send requests to this server to control a local browser. Leave this server running
References
Protractor Tutorial
Protractor Docs: Config File Reference
CONNECT Man Page
POSIX Man Page
For me, this had happened due to incompatible versions of Node and Protractor.
My fix-
Update Node to latest version (v7.0.0 in my case)
Follow steps given here https://stackoverflow.com/a/19333717/1902831
Install latest protractor version (4.0.10 in my case) using:
npm install -g protractor
Open another terminal and execute these command:
webdriver-manager update
webdriver-manager start
Run tests in another terminal using:
protractor conf.js
If you are using the npm protractor-webdriver grunt plugin (https://www.npmjs.org/package/grunt-protractor-webdriver) you may exeprience same kind of error.
This is due to webdriver termination just before test ends. The test runs successfully and then you have a message like :
Session deleted: Going to shut down the Selenium server
Shutting down Selenium server: http://127.0.0.1:4444
Shut down Selenium server: http://127.0.0.1:4444 (OKOK)
d:\Projets\Clouderial\nodeProjects\cld-apps\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:145
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (d:\Projets\Clouderial\nodeProjects\cld-apps\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:145:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)
I resolve this using the keepAlive option in the grunt plugin.
Here is my Gruntfile.js config :
protractor_webdriver: {
options: {
keepAlive : true // True to keep the webdriver alive
},
start: {
},
},
...
I hope this will help someone.
JM.
I also faced the same problem,the trick that worked for me is to use two cmd windows,keeping the one open after typing webdriver-manager start and without pressing enter key(if enter key is pressed the selenium server is shutdown,don't know why) open another cmd window and call your tests.
#Alexandros Spyropoulos, it took me quite some time to figure out how to run protractor and I think we had the same problem. You should open one terminal tab and run webdriver-manager start --standalone. Then open another terminal tag and run protractor ***.conf.js
In the hopes that it might help someone: I'd been having the same problem - encountering ECONNREFUSED using grunt-protractor-runner. The nuance to my case is that I was running my entire E2E environment (test files, web application and entire backend) within a Docker container.
I tried running protractor
with and without additional grunt-protractor-webdriver task to get webdriver up and running 'manually' (no difference);
with and without enabling directConnect and keepAlive settings (bypassing Selenium and resulting in crashes related to Chromedriver, one of which was described here).
The solution was rather simple: increase the amount of memory allocated to the container. On my Windows 10 host machine, I performed the following steps:
Run VBoxManage.exe modifyvm default --memory 8192 (via custom shell script) before starting the docker-machine (via Docker Quickstart script, which is equivalent to docker-machine start). (Thanks to this SO answer).
Changing my shell script to run my default container, adding the --shm-size=4G argument to my docker run command. (See docs)
You can verify if it worked by running df -h in your guest machine, by checking the amount of memory mounted on /dev/shm.
As a result, I no longer have seemingly inexplicable errors such as ECONNREFUSED.
If you run the provided protractor demo, you should try running the protractor config in the same command prompt as selenium. Try running both selenium server and protractor separately.
Make Sure first selenium runs by following command.
webdriver-manager start --standalone
And run the protractor in a separate command window.
protractor conf.js
(In my case conf.js was the config file )
I faced a similar issue to the one #David Remie faced with the Selenium Docker grid/standalone. With minimal RAM/CPU, the tests would start before the webdriver was up. A less resource consuming approach is to wait a few seconds before testing (run 'sleep 5' or something like that).
Increasing RAM was sometimes enough as a workaround for the issue, but the real problem was that the Selenium CMD (/opt/bin/entry_point.sh, starts a supervisor that runs the webdriver) from the image based on https://hub.docker.com/r/selenium/node-base/dockerfile was taking time to start the Selenium webdriver.
webdriver-manager start ----- didn't help, But below one helped
webdriver-manager start --standalone

Resources