I wrote a script to automate my app using appium with java-script(nodejs),but but when iI run it iI am getting error.
This is the code which iI 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();
});
});
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 iI am getting .