Unable to sendKeys in an EditText field Unable to sendKeys in an EditText field selenium selenium

Unable to sendKeys in an EditText field


As the element is in the webview, you need to find the element html using chrome/firefox as the android ui automator would not be able to detect that element.

To get the html of the element, you need to connect your device with chrome and go to chrome://inspect, now operate in your app and open the webview, you would find your device in the chrome://inspect link as soon as the webview gets opened, you need to select your device from there and you would see the replica of the webview, from there you can inspect the element and find the html of the element and using that html you can get the xpath.

Now you have got the xpath, you just need to switch the driver to the webview from your code now and then you can enter the value in the field using sendKeys() method.


I haven't tried this, but you could send adb shell command input text. after clicking the element.

with the Appium mobile command feature.

https://appium.io/docs/en/commands/mobile-command/


If focus is not in the textfiled after page is loaded, you need:

element.click();

before

element.sendKeys();