I followed instructions in the document on how to install protractor and selenium and I am unable to start.
install -g protractor
webdriver-manager update
After that I tried
webdriver-manager start and I got an error
events.jst:72
throw er; // Unhandeled 'error event
Error: spawn ENOENT
at errnoException (child_projcess.js:980:11)
at Process.ChildProcess._handle.onexeit (child_process.js:771:34)
If I do webdriver-manager status I get this
selenium standalone is up to date
chromedriver is up to date
IEDriver is not present
What is going on?
Install JDK. For me also, the same issue was there and got solved by installing JDK
I was not able to replicate this issue. Running webdriver-manager update and then webdriver-manager start worked for me on a fresh system.
However, here's how you can download and start the webdriver yourself:
java -jar /path/to/selenium-server-standalone-2.XX.0.jar (filling in the correct path)INFO: Launching a standalone server. Wait until you see a bunch of lines under that and then you can run your test.Note that you will possibly need to change the browser you are running your test in. If you are running the example, you would change 'browserName': 'chrome' to 'browserName': 'firefox' in example/conf.js. You could also download and configure the chrome driver yourself, but that would be more complicated.
This doesn't help with the main issue, but it might help you get started with testing.
You'll need java to run the selenium-server-standalone, with either method. Closing since this seems answered!
I'm getting a similar issue - running cygwin on Windows 7.
java -jar node_modules/protractor/selenium/selenium-server-standalone-2.39.0.jar works, but webdriver-manager start throws an error on line 221:
process.stdin.resume();
$ node_modules/protractor/bin/webdriver-manager start
seleniumProcess.pid: 9872
events.js:72
throw er; // Unhandled 'error' event
^
Error: read ENOTCONN
at errnoException (net.js:883:11)
at Socket._read (net.js:389:21)
at Socket.Readable.read (_stream_readable.js:294:10)
at Socket.read (net.js:291:43)
at new Socket (net.js:185:10)
at process.stdin (node.js:660:19)
at Object.
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
Although I can call java from the Windows cmd without having it set in PATH I needed to add JDK /bin folder manually to it to make webdriver-manager start to work.
Regards, hope this helps others having the same issue... :)
@maheswaranunni and @conceptdeluxe thank you so much for this. Solved my problem in 2 minutes.
@jimmynavio Good going :) :+1:
Install JDK works for me
I've had similar error today. The message like
seleniumProcess.pid: undefined
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
...
is very hard to understand. It would be great to verify if Java is available at the beginning and show meaningful information to user (in case it is missing).
@tomikmar It means that java file is not found so node cannot spawn java. Check your path and environment settings.
I am getting the same issue
seleniumProcess.pid: undefined
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT @tomikmar . How did you resolve your issue. I updated to java 8 and have updated the PATH environment variable. Still no luck :(
@sanavaali a good way to test if java is actually in your path is to try to run java from the user that will also run protractor.
โฏ java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
@cnishina Thank you. Resolved the issue after adding C:\Windows\System32 to PATH and start cmd as Administrator
hii sanavaali how to start cmd as administrator
I am installing protractor and i am unable to start
while i am writing below command it is showing error
webdriver-manager update
events.jst:160
throw er; // Unhandelled 'error event
please any one can help me to resolve this issue and run prottractor
[13:10:26] I/start - java -Dwebdriver.chrome.driver=C:...\BDD-POC\no de_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.31. exe -Dwebdriver.gecko.driver=C:...\BDD-POC\node_modules\protractor\n ode_modules\webdriver-manager\selenium\geckodriver-v0.18.0.exe -jar C:\Users\ns2 50360\BDD-POC\node_modules\protractor\node_modules\webdriver-manager\selenium\se lenium-server-standalone-3.4.0.jar -port 4444
[13:10:26] I/start - seleniumProcess.pid: undefined
[13:10:26] W/start - Selenium Standalone server encountered an error: Error: spa wn cmd ENOENT
1.The environment variable PATH is not set properly.
Hi All,
I am facing same issue while running my gitlab.yml file error:
/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar -port 4444
[15:17:51] I/start - seleniumProcess.pid: undefined
[15:17:51] W/start - Selenium Standalone server encountered an error: Error: spawn Javascript ENOENT
$ npm run build
which is failing my webdriver test with error:
[15:17:55] I/launcher - Running 1 instances of WebDriver
[15:17:55] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[15:17:55] E/runner - Unable to start a WebDriver session.
[15:17:55] E/launcher - Error: Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
at ClientRequest.
at ClientRequest.emit (events.js:182:13)
Could you please help me out how to set the path of javascript inside gitlab. I am using windows 10 and (protractor-cucumber-typescript project).
Please help me out
1.The environment variable PATH is not set properly.
- Selenium requires Java. Add Java path in the environment variable PATH.
How do you do that?
Running these command help me to sort this issue;
....
[16:34:21] I/start - seleniumProcess.pid: 14954
16:34:21.572 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
....
Most helpful comment
Install JDK. For me also, the same issue was there and got solved by installing JDK