I am encounteing following error when starting an end to end test using protractor.
manu#MANU:/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app$ ./node_modules/protractor/bin/protractor ./conf.js
[16:29:47] I/launcher - Running 1 instances of WebDriver
[16:29:47] I/direct - Using ChromeDriver directly...
[16:29:47] E/launcher - EINVAL: invalid argument, uv_interface_addresses
[16:29:47] E/launcher - Error: EINVAL: invalid argument, uv_interface_addresses
at Error (native)
at getLoInterface (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/selenium-webdriver/net/index.js:30:20)
at getAddress (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/selenium-webdriver/net/index.js:46:14)
at Object.exports.getLoopbackAddress (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/selenium-webdriver/net/index.js:85:10)
at resolveCommandLineFlags.then.args (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/selenium-webdriver/remote/index.js:240:24)
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
at Function.createSession (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at Function.createSession (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/selenium-webdriver/chrome.js:709:29)
at Direct.getNewDriver (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/lib/driverProviders/direct.ts:90:25)
at Runner.createBrowser (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/lib/runner.ts:225:39)
at q.then.then (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/lib/runner.ts:391:27)
at _fulfilled (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/q/q.js:796:13)
at /mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/q/q.js:137:13)
[16:29:47] E/launcher - Process exited with error code 199
manu#MANU:/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app$
I could be because of issue in starting webdriver. I tried to run selenium but I got following error
manu#MANU:/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app$ ./node_modules/protractor/bin/webdriver-manager start
[16:27:55] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.32 -Dwebdriver.gecko.driver=/mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.18.0 -jar /mnt/c/Users/Manu/Documents/manu/programs/web/angular/dw-ng2-app/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.3.jar -port 4444
[16:27:55] I/start - seleniumProcess.pid: undefined
[16:27:55] W/start - Selenium Standalone server encountered an error: Error: spawn java ENOENT
I have tried cleaning and restarting using clean and start options with webdriver-manager but that hasn't solved the problem
Update---
I am running this on Windows machine through Bash for Windows. The issue with starting Selenium is Bash cannot find Java. I exported Path but because Java is installed in Program Files, I am unable to set the path in Bash as Bash is unable to process the space in Program Files. I could run the selenium server on CMD where JAVA path is set. The problem is still not resolved though.
It seems the issue was I didn't install correctly the first time. I should have run webdriver-manager update from home directory. I cleaned up using webdriver-manger clean and re-run webdriver-manger start from project's home directory project home> .\node_modules\protractor\bin\webdriver-manager start. Probably the installation sets some paths which get messed up if some other directory is used. I also started protractor from project's home directory >node .\node_modules\protractor\bin\protractor .\protractor.conf.js
Related
why webdriver-update command not found although protractor is installed ?
i installed protractor node as
sudo npm install protractor -g
and when i try to make
sudo webdriver-manager update
it return with
sudo: webdriver-manager: command not found
i tried also to install it manually but i failed to do.
tamer#tamer-Inspiron-N5110:/media/tamer/Work/conFusion/test$ protractor protractor.conf.js
[15:23:48] I/direct - Using ChromeDriver directly...
[15:23:48] I/launcher - Running 1 instances of WebDriver
[15:23:48] E/direct - Error code: 135
[15:23:48] E/direct - Error message: Could not find chromedriver at /home/tamer/.npm-global/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22
[15:23:48] E/direct - Error: Could not find chromedriver at /home/tamer/.npm-global/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22
at Direct.getNewDriver (/home/tamer/.npm-global/lib/node_modules/protractor/built/driverProviders/direct.js:65:27)
at Runner.createBrowser (/home/tamer/.npm-global/lib/node_modules/protractor/built/runner.js:198:43)
at /home/tamer/.npm-global/lib/node_modules/protractor/built/runner.js:277:30
at _fulfilled (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:137:13)
at flush (/home/tamer/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:125:13)
at nextTickCallbackWith0Args (node.js:420:9)
[15:23:48] E/launcher - Process exited with error code 135
tamer#tamer-Inspiron-N5110:/media/tamer/Work/conFusion/test$ sudo webdriver-manager update
[sudo] password for tamer:
sudo: webdriver-manager: command not found
Root Causes of your issue might Node REPL unable to pick up the installed node_module
Can you try one of below and see
In order to make modules available to the Node.js REPL, it might be useful to add <</usr/lib>>/node_modules folder to the $NODE_PATH environment variable.
Refer here for more info
Goto .\node_modules\protractor\bin and execute the webdriver-manager trigger script directly.
node webdriver-manager update
I am new to protractor. I am getting the following error while trying to run Selenium tests using protractor
I/hosted - Using the selenium server at http://localhost:4444/wd/hub
I/launcher - Running 1 instances of WebDriver
E/launcher - Error code: 135
E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
at ClientRequest.<anonymous> (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:381:15)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:267:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1269:8)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
From: Task: WebDriver.createSession()
at Function.createSession (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Builder.build (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\driverProvider.js:37:33)
at Runner.createBrowser (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\built\runner.js:187:43)
at c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\built\runner.js:261:30
at _fulfilled (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
E/launcher - Process exited with error code 135
I checked to see if any other process is listening to port 4444, but did not find any. also I am running web driver with --standalone flag.
It seems like selenium server is not running on http://127.0.0.1:4444/wd/hub. Before running your protractor test,you must start the selenium server using below command.webdriver-manager start. After starting the server your tests will execute without any errors.
If you dont want to start selenium server manually,then just remove seleniumAddress:http://localhost:4444/wd/hub property from your conf.js.
You can also add these lines to your conf.js file:
chromeOnly: true,
directConnect: true,
Start the webdriver, its good to update the web driver and start the web driver before you start executing your automation test suite by executing the below commands in console screen.
webdriver-manager update
webdriver-manager start
Do you have selenium drivers installed for the browser you want to test with?
Try with
webdriver-manager update
It will take care of installing the drivers for you. You just need to run it once, if you call it again it will see that the drivers are already installed and will not procede.
Did you start selenium server using this command webdriver-manager start?
If not there might be a problem with your configuration with selenium server.
I would suggest follow this thread
Solution 1
try webdriver-manager update --standalone
Solution 2
Remove previous instance (.jar file) of web driver from the location- C:\Users\HP\AppData\Roaming\npm\node_modules\p rotractor\selenium
Download the selenium-server-standalone-2.45.0 from http://www.seleniumhq.org/download/ and replace the .jar file.
i also get this type of error, but after set environment variables this issue is solved.
location of the npm;
Example:
C:\Users\AppData\Roaming\npm
The directConnect solution is nice when running protractor locally, but it didn't work when trying to do it on Jenkins. It seems like when running everything in Docker containers in Jenkins, you'll have to start webdriver-manager start in detached mode -d first, wait, and then start protractor.
check your web driver status by the below command
webdriver-manager status
if it's not up to date you can remove and install it by following these steps
webdriver-manager clean
webdriver-manager status
webdriver-manager update
webdriver-manager start
then start your web driver by
if you get this error
ERROR [BaseServer.start] - Port 4444 is busy, please choose a free port and specify it using -port option
you can set another port by this command(for example port 4545)
webdriver-manager start --seleniumPort 4545
then your selenium web driver will run
I have run the windows command prompt as administrator and solved this problem. I am not seeing this problem anymore.
And I added also
chromeOnly: true,
directConnect: true,
Problem
I'm trying to get AppVeyor running some e2e tests using Protractor and Selenium-webdriver.
Everything works fine on my local machine, but when building and testing on AppVeyor protractor exits with code 1 due to a not-found method in the selenium-webdriver, it seems. I have tried to get some information on the error message, but my search didn't get me anywhere. Most of the result come from backend testing with Java.
Here is a snippet of the buildlog:
node_modules\.bin\gulp protractor
[08:37:23] Using gulpfile C:\projects\kitos\gulpfile.js
[08:37:23] Starting 'protractor'...
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://10.240.0.18:63619/wd/hub
..
Finished in 42.225 seconds
2 tests, 2 assertions, 0 failures
C:\projects\kitos\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108
var template = new Error(this.message);
^
UnknownError: Can't obtain updateLastError method for class com.sun.jna.Native
at new bot.Error (C:\projects\kitos\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
at Object.bot.response.checkResponse (C:\projects\kitos\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
at C:\projects\kitos\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:379:20
at [object Object].promise.ControlFlow.runInFrame_ (C:/projects/kitos/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
at [object Object].goog.defineClass.notify (C:/projects/kitos/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
at [object Object].promise.Promise.notify_ (C:/projects/kitos/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
at Array.forEach (native)
at [object Object].promise.Promise.notifyAll_ (C:/projects/kitos/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
at goog.async.run.processWorkQueue (C:\projects\kitos\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:130:15)
at process._tickCallback (node.js:368:9)
[launcher] Process exited with error code 1
[08:38:13] 'protractor' errored after 50 s
[08:38:13] Error in plugin 'gulp-protractor'
Message:
protractor exited with code 1
The selenium server is running, tests passes but when the server is about to shut down the error occurs.
Setup
On build start I run npm install which in turn runs node_modules\\.bin\\webdriver-manager update --standalone as a postinstall script.
Protractor is run with a gulp task with the gulp-protractor plugin and the selenium standalone jar is defined in the protractor configuration as seen here:
exports.config = {
seleniumServerJar: '../node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
specs: ['Tests/**/*e2e.spec.js'],
resultJsonOutputFile: 'results-protractor.json',
allScriptsTimeout: 30000
};
The complete buildlog can be seen here: https://ci.appveyor.com/project/Crevil/kitos/build/1.0.187
Apologizing for the noisy log. The deployment logging is very loud in the console and it is not configurable on AppVeyor afaict.
Local log information
As mentioned, everything runs fine on my local machine. Here is a log of protractor running.
C:\Users\BSO\Documents\Git repos\kitos>gulp protractor
[09:54:58] Using gulpfile ~\Documents\Git repos\kitos\gulpfile.js
[09:54:58] Starting 'protractor'...
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.5.153:16772/wd/hub
..
Finished in 5.241 seconds
2 tests, 2 assertions, 0 failures
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
[09:55:08] Finished 'protractor' after 10 s
C:\Users\BSO\Documents\Git repos\kitos>
This issue is solve with the following parameter to the java runtime engine
localSeleniumStandaloneOpts: {
args: ['-Djna.nosys=true']
},
...
There are more details in the protractor issue here and the specific solution by Feodor Fitsner.
I'm bringing this into discussion here, since I had started this conversation over GithubIssue 2630, Basically I'm having problems with the integration of Protractor and Cucumber, I had even tried to downgrade to a older versions for both but the same thing happens, here's an explanation of what I did so far:
I had uninstalled everything and started from scratch. I started by installing Protractor, Cucumber and Webdriver globally and I can see this error, same as before, when I run the protractor command.
$ protractor conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.0.104:64737/wd/hub
[launcher] Error: TypeError: undefined is not a function
at /usr/local/lib/node_modules/protractor/lib/frameworks/cucumber.js:150:36
at Function.promise (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:650:9)
at /usr/local/lib/node_modules/protractor/lib/frameworks/cucumber.js:147:14
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49
at flush (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:355:11)
[launcher] Process exited with error code 100
```
Then I've installed all locally, running npm install, and I got this error
[launcher] Process exited with error code 1
/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:126
throw e;
^
Error: No selenium server jar found at the specified location (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar). Check that the version number is up to date.
at LocalDriverProvider.addDefaultBinaryLocs_ (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/driverProviders/local.js:37:11)
at LocalDriverProvider.setupEnv (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/driverProviders/local.js:71:8)
at Runner.run (/Users/brunosoko/Documents/Dev/Personal/olapic-test2/node_modules/protractor/lib/runner.js:261:31)
at TaskRunner.run (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/taskRunner.js:123:19)
at createNextTaskRunner (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/launcher.js:223:20)
at /Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/lib/launcher.js:246:7
at _fulfilled (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:759:13)
at /Users/brunosoko/Documents/Dev/Personal/test2/node_modules/protractor/node_modules/q/q.js:573:44
Which I resolved by installing locally webdriver ./node_modules/.bin/webdriver-manager update
Then I ran ./node_modules/.bin/protractor conf.js and I'm getting the same error as above, for cucumber.js:150:36
Later, I tried to uninstall globally framework, npm uninstall -g protractor and npm uninstall -g cucumber
But the same error happens! I'm not sure what am I doing wrong!
I'm not sure what is wrong with your specific situation, but I have created a bare minimum example of cucumber 0.8.1 working with the yet to be released version of protractor here - https://github.com/darrinholst/protractor-cucumber-example. Hope this helps.
git clone https://github.com/darrinholst/protractor-cucumber-example
cd protractor-cucumber-example
npm install
npm test
I am facing a problem when starting webdriver-manager in node_modules\protractor with windows 7. the command is :
node webdriver-manager start
Then I got the following error messages:
seleniumProcess.pid: undefined
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at exports._errnoException (util.js:742:11)
at Process.ChildProcess._handle.onexit (child_process.js:1028:32)
at child_process.js:1109:20
at process._tickCallback (node.js:343:11)
at Function.Module.runMain (module.js:492:11)
at startup (node.js:124:16)
at node.js:807:3
After searching on the Internet, I cannot find any similar question like mine that the seleniumProcess.pid is undefined.
Following is the output for java -version:
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Any idea?
Ok, I figured out why I had this problem. You have only JRE, but
You will need to have the Java Development Kit (JDK) installed to run
the standalone Selenium Server. Check this by running java -version
from the command line. Tutorial
On Ubuntu I've done
$ sudo apt-get install openjdk-7-jdk
And now I have this Java:
$ java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
And webdriver-manager start works.
Error:
C:\XXXX\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriv
er-manager\bin>webdriver-manager --verbose update
events.js:160
throw er; // Unhandled 'error' event
^
Error: unable to verify the first certificate
at Error (native)
at TLSSocket. (_tls_wrap.js:1092:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:610:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
I did the following to remove this:
Try:
1. C:\XX\Roaming\npm\node_modules\protractor\node_modules\webdriv
er-manager\bin>webdriver-manager --proxy http://username:passwd#IP:port
080/ update
(Then it updated drivers in the location)
webdriver-manager status
C:\XX\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\bin>webdriver-manager --verbose start
It is started working,
I expect this is happening repeatedly due to corruption of drivers. May we need to graceful stop to work.
Try to add C:\Windows\System32\ there (right-click My Computer -> Properties -> Advanced system settings -> Environment Variables -> Edit... PATH and add C:\Windows\System32 to the end (with a semi-colon separating each variable).