sendKey not working for android.view.View class

My appium version is

There is an object on the screen (a passcode field) where I want to pass some text into it.
Below are the details of it:
index 1
resource-id FLD_PASSCODE_item
class android.view.View
content-desc Passcode

I am using the following code:

I am observing that the sendKeys feature is not working. Can anybody help here please.

I am also attaching the screenshot of the image taken from the UIAutomator tool.

try driver.tap() before using send keys

WebElement element = driver.findElement(By.xpath(" "));

@amitjaincoer191, i think this element is inside web view. so It will not work if remoteDebug option is not enable with UIAutomator. If that is the case then i think switch to selendroid mode is better option.

Yes u r right my mistake, in UI Hierarchy I missed to see this class “android.webkit.WebView”

We have different way to handle webView elements. Elements under this class “android.webkit.WebView” are inside webview.

Helper Link :

@amitjaincoer191 and @Priyank_Shah : Just one clarification i would like to make and that is ,the class here were are talking about is of the type andriod.view.View.

But it is under parent “android.webkit.WebView” see this class u can see if u see above …

To clarify, these elements are rendered as web browser and not as android native elements inside app so to handle these elements we have different way …

The app should be rebuild with webview debugger enabled
You need to setContext of app to webview
You need to inspect these elements in chrome browser instead of appium inspector / uiautomator viewer

Is there any documentation where I can go through for the same plz

official documentation

I explained it here

1 Like

I will share with you another image from the same app, where even if it is in Webcontext mode, but still I can be able to use the sendkeys features. Can you explain me plz why the same is happening then please.

@amitjaincoer191 Thanks very much! I think this is very helpful for what I’m going to meet with.

Hi @sayom88;

were you able to find a solution for this ? I’m facing the same issue
Thanks in advance

try using set_text("[email protected]") or uninstall current selenium install selenium==3.3.1

You can watch this :