I have written a code where it will launch the app, click on the login button, enter username and password and click on sign in.
When I run this using node ‘filename’ it is running fine with no issue.
When I run using mocha node_modules/mocha/bin/mocha ‘filename’ I am getting the error I am not able to understand as to why?
This is the error that I am getting:
2019-01-02T06:52:42.721Z DEBUG wdio-config: wdio-sync not found, running tests asynchronous
/home/user/newtest/node_modules/webdriverio/src/utils.js:199
(typeof caps[‘appium-version’] !== ‘undefined’) ||
^
TypeError: Cannot read property ‘appium-version’ of undefined
at mobileDetector (/home/user/newtest/node_modules/webdriverio/src/utils.js:199:21)
at Object.remote (/home/user/newtest/node_modules/webdriverio/src/index.js:35:29)
at Object.<anonymous> (/home/user/newtest/test13.js:16:21)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:659:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /home/user/newtest/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/home/user/newtest/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/home/user/newtest/node_modules/mocha/lib/mocha.js:576:10)
at Object.<anonymous> (/home/user/newtest/node_modules/mocha/bin/_mocha:637:18)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:776:12)
at executeUserCode (internal/bootstrap/node.js:342:17)
at startExecution (internal/bootstrap/node.js:276:5)
at startup (internal/bootstrap/node.js:227:5)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
Source: Read More