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
text
resource-id FLD_PASSCODE_item
class android.view.View
package glb.farms.mobile
content-desc Passcode
I am using the following code:
driver_and.findElement(By.xpath("//android.view.View[@resource-id=‘FLD_PASSCODE_item’]")).sendKeys(“1234”);
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.
@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.
@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
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.