'no such element in Js webdriverio with Appium . and how to use promise here?

We run this coming promise error. We use the await function but not working correctly.

**java script

 var wdio = require('webdriverio'); 
 var allureReporter = require('@wdio/allure-reporter').default; 
 var assert = require('assert'); 
 describe('Test cases for EriBank', () => 
 { 
 it('TC_01_Sign In To The Account', async () => { 
 allureReporter.addDescription('User should be able to login to the 
 account and verify the home page');
 driver. Pause(20000);
   username = await $("//android.widget.EditText[@text='Username']"); 
   username.setValue('company');
 }); 
 });



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source