I wrote a script to automate my app using appium with java-script(nodejs), but when I run it I am getting error.
This is the code which I have written.
var webdriverio = require('webdriverio');
var except = require('chai').expect;
var config = require(
{
port: 4723,
desiredCapabilities: {
platformName: "Android",
platformVersion: "8.1.0",
deviceName: "00b8afc289da4196",
app: "/home/user/auto_test/xxx.apk",
automationName: "UiAutomator2"
}
});
const client = webdriverio.remote(config);
//addition testing
describe("Simple cases", function () {
before(function () {
this.timeout(50000);
return client.init();
});
afterEach(function(){
this.timeout(50000);
return client.init();
});
describe("test-signup", function(){
it("signup_click", function(){
client
.click('android=new UiSelector().resourceId("com.xxx.xxx:id/txt_log_in")')
});
});
after(function() {
return client.end();
});
});
And this is the error which I am getting.
2019-01-02T11:49:15.769Z DEBUG wdio-config: wdio-sync not found, running tests asynchronous
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object
at Module.require (internal/modules/cjs/loader.js:653:11)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/home/user/automation/tile2.js:3:14)
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)