webdriver-manager update failed to download chrome driver and update-config.json - protractor

When I clean webdriver-manager and update, it is unable to download chrome driver and update-config.json. Later on when I start protractor it is complaining couldn't find update-config.json.
package.json
"scripts": {
"webdrivermanager:update": "node node_modules/protractor/bin/webdriver-manager update --versions.standalone=3.4.0 --ignore_ssl",
"webdrivermanager:clean": "node node_modules/protractor/bin/webdriver-manager clean",
"install": "npm run webdrivermanager:clean && npm run webdrivermanager:update"
}
protractor.conf.js
seleniumServerJar: '../../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.4.0.jar',
multiCapabilities: [
{browserName: 'chrome'}
//specify if any other browser
],
directConnect: true,
Now when I do npm install, I can not see chrome driver and
update-config.json at
node_modules\protractor\node_modules\webdriver-manager\selenium
location
webdriver-manager update log
> node node_modules/protractor/bin/webdriver-manager update --versions.standalon
e=3.4.0 --ignore_ssl
[09:58:34] I/http_utils - ignoring SSL certificate
(node:10944) UnhandledPromiseRejectionWarning: Unhandled promise rejection (reje
ction id: 1): TypeError: Cannot read property 'ListBucketResult' of undefined
[09:58:34] I/downloader - curl -o C:\..\..\node_mo
dules\protractor\node_modules\webdriver-manager\selenium/selenium-server-standal
one-3.4.0.jar https://selenium-release.storage.googleapis.com/3.4/selenium-serve
r-standalone-3.4.0.jar
[09:58:35] I/downloader - curl -o C:\..\..\node_mo
dules\protractor\node_modules\webdriver-manager\selenium/geckodriver-v0.16.1.zip
https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0
.16.1-win64.zip
[09:58:36] I/update - geckodriver: unzipping geckodriver-v0.16.1.zip
In my log also chrome driver is not downloading anymore. For this reason I can not start my protractor as update-config.json is not available. Any idea would be great. Thanks

During a previous update call, the xml response was cancelled before the file could be created. There are two options (features to fix this are not complete yet):
delete the chrome-response.xml and then call update again
wait an hour and make an update request again. The last modified time will invalidate that file and it will make a request and will replace the chrome-response.xml.

On my end, if my webdriver-manager instance was closed.
I am required to delete npm and npm-cache folders from roaming and reinstall protractor again.
Right after installing protractor, webdriver-manager update needs to be executed immediately.
If an error appears, make sure to run node.js cmd as an admin.
With these steps, I was able to download drivers properly.

That was very weird. I did everything nothing helped. Actual reason was my organization blocked the chrome driver api site. chrome-response.xml is the main clue that is showing access denied message so, I came to know actual reason.
I requested to #cnishina to thrown an actual error message if chrome driver website is not reached.

Related

Probot version 7.2 is not starting my app

With probot 7.2, if I create a simple index.js like
module.exports = app => {
app.log('YYYYYYYEEEEEEEEEEEAAAAAAAAAAAHHHHHHHHH it is working!!!!')
}
This export is not working, as when I run the application, I never see my log message. The npm run dev give those log:
> test#1.0.0 dev /tmp/test
> nodemon
[nodemon] 1.18.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: .env *.*
[nodemon] starting `npm start`
> test#1.0.0 start /tmp/test
> probot run ./index.js
08:46:15.243Z INFO probot: Listening on http://localhost:3000
08:46:15.817Z INFO probot:
Welcome to Probot! Go to http://localhost:3000 to get started.
If I downgrade the version to 7.1 it is fine.
Is someone know if there is some (and which) change to do with 7.2 version ?
Just found out why, so I answer myself:
On 7.1 version, there is error when your start probot without the needed env variable.
On 7.2 those errors are not showing. You need to have env variable correctly set else it will simply start but silently fail to load your setup.
The env (or .env file) must define:
APP_ID=...
WEBHOOK_PROXY_URL=...
LOG_LEVEL=...
WEBHOOK_SECRET=...
PRIVATE_KEY=...
The complete possible env variables are defined in the documentation

howt o fix protractor that started failing on alerts all of a sudden

I have a project that has been running well for a long time now.
Recently (couple of weeks) the system tests are failing.
After a lot of investigation we concluded that protractor fails to identify and close an alert.
The code that used to work
exports.removeFaq = function( index ){
console.log('deleting item at',index);
exports.getContent(index).$( '[ng-click="removeFAQ($index)"]').click();
browser.sleep(2000);
browser.switchTo().alert().accept();
return browser.sleep(2000);
};
is now throwing errors:
WebDriverError: unknown error: cannot determine loading status
from unexpected alert open
(Session info: chrome=52.0.2743.116)
(Driver info: chromedriver=2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a),platform=Linux 4.2.0-38-generic x86_64) (WARNING: The server did not provide any stacktrace information)
and (using element explorer):
> browser.switchTo().alert().accept();
UnexpectedAlertOpenError: unexpected alert open: {Alert text : are you sure you want to remove this helper content?}
(Session info: chrome=52.0.2743.116)
(Driver info: chromedriver=2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a),platform=Linux 4.2.0-38-generic x86_64) (WARNING: The server did not provide any stacktrace information)
We've tried
- waiting instead of sleeping.
- sleeping for a long period
- ignoring angular.
nothing seems to make any difference whatsoever.
how can I fix this?
We had the same issue for a couple of days. Looks like we were on chromedriver 2.21. I updated to the latest version (2.23) and that seems to have fixed the issue.
The command webdriver-manager update --chrome did not work for me so I had to download the zip and extract it to my selenium directory. Under protractor.
Note there is a new protractor major version with updated versions. So updating protractor might fix the problem too.
for protractor version 3.x
You can also modify the file node_modules/protractor/config.json with the correct version and then run webdriver-manager update
for protractor version 4.x
You should modify the file ./node_modules/protractor/node_modules/webdriver-manager/config.json instead.
How can we say for sure that sleep of 2000ms is good enough? Exactly for this reason sleeps are not recommended in tests. Instead you can use proper waits and poll for alert. This way you would know that after a certain agreed timeout, alert never showed up and test rightfully failed
//wait maximum up to lets 5s before giving up
browser.wait(protractor.ExpectedConditions.alertIsPresent(), 5000);
browser.switchTo().alert().accept();

Running appium with command line from eclipse : Could not initialize ideviceinstaller

First post.
Hi, I'm trying to run appium by executing the following command lines from eclipse:
Process pr = rt.exec(new String[] {"/usr/local/bin/node", "/usr/local/bin/appium"});
And then I run an AppiumDriver with the url and it's capabilities (also from eclipse): AppiumDriver ad = new AppiumDriver(new URL(url), this.capabilities);
These errors follow:
[36minfo[39m: [debug] Dynamic bootstrap path:
/Users/philippe.pageau/Library/Application
Support/appium/bootstrap/bootstrap-072528be314c3cc6.js
[36minfo[39m:
[debug] Reusing dynamic bootstrap:
/Users/philippe.pageau/Library/Application
Support/appium/bootstrap/bootstrap-072528be314c3cc6.js
[36minfo[39m:
[debug] Attempting iOS device log capture via libimobiledevice
idevicesyslog
[33mwarn[39m: Could not capture device log using
libimobiledevice idevicesyslog. Libimobiledevice probably isn't
installed
[36minfo[39m: [debug] Attempting iOS device log capture
via deviceconsole
[33mwarn[39m: Could not capture logs from device.
Continuing without capturing logs.
[36minfo[39m: [debug] Creating iDevice object with udid XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[36minfo[39m: [debug] Couldn't find ideviceinstaller, trying
built-in at
/usr/local/lib/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
[36minfo[39m: [debug] Cleaning up appium session [36minfo[39m:
[debug] Error: Could not initialize ideviceinstaller; make sure it is
installed and works on your system
at [object Object].IOS.getIDeviceObj (/usr/local/lib/node_modules/appium/lib/devices/ios/ios.js:909:13)
at [object Object].IOS.installToRealDevice (/usr/local/lib/node_modules/appium/lib/devices/ios/ios.js:856:32)
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:607:21
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:246:17
at iterate (/usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:146:13)
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:157:25
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:248:21
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:612:34
at [object Object]. (/usr/local/lib/node_modules/appium/lib/devices/ios/ios.js:1527:14)
at /usr/local/lib/node_modules/appium/node_modules/underscore/underscore.js:890:21
at [object Object]._onTimeout (/usr/local/lib/node_modules/appium/lib/devices/ios/ios-log.js:166:7)
at Timer.listOnTimeout (timers.js:110:15)
[36minfo[39m: [debug] Responding to client with error: {"status":33,"value":{"message":"A
new session could not be created. (Original error: Could not
initialize ideviceinstaller; make sure it is installed and works on
your system)","origValue":"Could not initialize ideviceinstaller; make
sure it is installed and works on your system"},"sessionId":null}
[36minfo[39m: [37m<-- POST /wd/hub/session [39m[31m500[39m[90m
11133.802 ms - 300[39m [90m[39m
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could
not be created. (Original error: Could not initialize
ideviceinstaller; make sure it is installed and works on your system)
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 11.35 seconds
The errors show that it didn't find ideviceinstaller nor libimobiledevice (which I both installed)
I followed these instructions
Appium throws "ideviceinstaller" not found when launched through Eclipse - Java
http://technotesonthego.blogspot.ca/2013/10/install-libimobiledevice-on-mac-os-x.html
Note that I wish to execute everything from eclipse, allowing the QA to not worry about those things. It works with the GUI (I uninstalled it afterwards) and it also works when I run appium in the terminal and execute AppiumDriver ad = new AppiumDriver(new URL(url), this.capabilities); with eclipse.
I did my research, and asking the question to stackoverflow is my last resort.
Did I miss something?
EDIT
Also, I tried executing /usr/local/lib/node_modules/appium/build/libimobiledevice-macosx/ideviceinstall‌​er and it gave me this error : dyld: Library not loaded: #executable_path/../lib/libimobiledevice.3.dylib Referenced from: /usr/local/lib/node_modules/appium/build/libimobiledevice-macosx/ideviceinstalle‌​r Reason: image not found Trace/BPT trap: 5
Tried on Appium 1.4.8:
Step 1: install the "brew" command
Step 2: run the following command: brew install --HEAD ideviceinstaller
Step 3 (optional): click Appium/Reset Preferences and then close & open Appium
Good luck.

DocPad plugin: odd errors when testing, hangs when including in project

I'm trying to write a DocPad plugin to import MongoDB docs into the DocPad database for use in a static website. The source code is at https://github.com/nfriedly/docpad-plugin-mongodb and it's based on https://github.com/docpad/docpad-plugin-tumblr
When I run cake test, I get this output:
cake compile
cake install
npm install (for app)
npm install (for test)
npm install (for docpad tests)
coffee compile
npm test
> docpad-plugin-mongodb#2.0.0 test c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> npm run prepare_test_db && node ./out/mongodb.test.js
> docpad-plugin-mongodb#2.0.0 prepare_test_db c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> mongo test/prepare_database.mongo.js
MongoDB shell version: 2.6.5
connecting to: test
connecting to: docpad_plugin_mongodb_test
mongodb
mongodb > create
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
at c:\Users\IBM_ADMIN\docpad-plugin-mongodb\node_modules\docpad\out\lib\docpad.js:4107:17
at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
mongodb > create OK
mongodb > load plugin mongodb
mongodb > load plugin mongodb OK
mongodb > generate
mongodb > generate > action
warning: You have multiple files being written to c:\Users\IBM_ADMIN\docpad-plugin-mongodb\test\out\testData\1.json, they are:
- testData/1.json:c7
- testData/1.json:c5
Rename one of them to avoid an over-write
FAILURE: 2/3 tests ran successfully; 0 failed, 1 incomplete, 0 errors
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:99
throw err;
^
Error: Process exited with error status code
at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:88:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
And, when I include the module in my project, it just hangs after this:
$ docpad run
info: Welcome to DocPad v6.69.1 (local installation: c:\Users\IBM_ADMIN\watson-developer-cloud\node_modules\docpad
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docp
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: eco, mongodb
info: Environment: development
info: DocPad listening to http://0.0.0.0:9778/ on directory c:\Users\IBM_ADMIN\watson-developer-cloud\out
(And if I visit localhost:9778, it just hangs and never loads a page)
It seems like it only displays logs from plugins after the first pass is complete, so I started adding throw statements to see what it was doing. It seems that it imports things from mongo successfully, and it creates the document, but when the plugin calls document.action 'load', (err) ->, that callback is never fired.
Can anyone provide some guidance on what I'm messing up and how to get things working smoothly?
Fixed it. The TaskGroup library (apparently) once had a .once('complete', callback) event that no longer works. Switching it to .done(callback) (and fixing a couple of other small bugs) got me working now.
It still gives me the "Error: Didn't place the skeleton as the desired structure already exists" but the tests all pass now, so I'll call it a win.

Derby app created using 'derby new test' not working

I've installed derbyjs using npm install -g derby and then created a test app using derby new test.
Then i started the app using node server.js and I got the following output:
info - socket.io started
Starting cluster with 1 workers in undefined mode
`kill -s SIGUSR2 7161` to force cluster reload
Go to: http://localhost:3000/
info - socket.io started
So I tried to request http://localhost:3000/, but the site does not finish loading and I get the following exception:
TEMPLATE ERROR
Error: Model mutation performed after bundling for clientId: 79f4a9f3-25fc-438d-b9f4-a450dccf9566
at Model.errorOnCommit [as _commit] (/web/derby/test/node_modules/derby/node_modules/racer/lib/bundle/bundle.Model.js:64:9)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:120:15
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:107:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:101:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:92:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at Object.run (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: Cannot write after end
at Gzip.write (zlib.js:311:31)
at ServerResponse.res.write (/web/derby/test/node_modules/express/node_modules/connect/lib/middleware/compress.js:82:18)
at Object.View._render (/web/derby/test/node_modules/derby/lib/View.server.js:337:9)
at /web/derby/test/node_modules/derby/lib/View.server.js:276:10
at Array.2 (/web/derby/test/node_modules/derby/lib/View.server.js:300:5)
at Object.Promise.resolve (/web/derby/test/node_modules/derby/node_modules/racer/lib/util/Promise.js:21:19)
at /web/derby/test/node_modules/derby/lib/View.server.js:136:17
at /web/derby/test/node_modules/derby/lib/files.js:224:7
at Object.oncomplete (fs.js:308:15)
at process._makeCallback (node.js:248:20)
I have absolutely no idea how I can get it running... Is it a bug, or am I doing something wrong?
Update
I've created a bug report on the derby repository: https://github.com/codeparty/derby/issues/170