Not able to access login fields in "android.webkit.WebView"

1,988 views
Skip to first unread message

Amit Dewan

unread,
Jan 31, 2014, 8:31:19 AM1/31/14
to appium-...@googlegroups.com
In my application I am stuck on "android.webkit.WebView"
Actually I have login and password field inside "android.webkit.WebView"  and I am not able to automate these fields through Appium.
UIAutomator Viewer also shows the class of full frame as "android.webkit.WebView" and is not recognizing fields within it.
Please tell if you have any solution.
Thanks

bootstrap online

unread,
Jan 31, 2014, 9:47:55 AM1/31/14
to Amit Dewan, appium-...@googlegroups.com
Use API 19. Reactivate the webview until the login fields show up as
textfields. This assumes you're using uiautomator. For selendroid, it
should just work although the API is different.
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.

Amit Dewan

unread,
Jan 31, 2014, 11:58:58 PM1/31/14
to appium-...@googlegroups.com
I am currently testing with API 17 or API 18.
Do you mean to say elements will be detected with API 19??
Can you give me some example?
Thanks

bootstrap online

unread,
Feb 1, 2014, 12:02:05 AM2/1/14
to Amit Dewan, appium-...@googlegroups.com
Yes, only API 19. The standard element finding methods work.

Jim Ketty

unread,
Feb 3, 2014, 8:53:17 AM2/3/14
to appium-...@googlegroups.com, Amit Dewan
Hi bootstrap,

I'm also facing a similar issue where I'm blocked to access the 'android.webkit.WebView' element on the Login page of android native app. Based on your above update, I'm using Nexus7 running on Android ver[4.4.2] i.e. API 19.

The login page of the android native app is a webview having two fields username and password, both belonging to the class (android.widget.EditText). The id for these elements are not displayed, therefore I fail to access them directly by standard element finding methods. I have tried using the driver.switchTo().window("WEBVIEW").

Only information on these fields that I get from the UI Automator Viewer is the 'content - description' for each of these fields. I have also tried to find element using the content-description(findElement(By.name("content-description text"))), but it does not work. I'm currently blocked to automate these fields by sending in test data using Appium.

Please help me out with a possible solution to this issue?

Thanks,
Jim

bootstrap online

unread,
Feb 3, 2014, 9:07:02 AM2/3/14
to Jim Ketty, appium-...@googlegroups.com, Amit Dewan
On API 19 I'm able to login to webviews such as Facebook and dropbox.
Sometimes I have to reload the webview if the elements aren't found.
In Ruby, the typing code is like this:

textfield(0).type 'em...@example.com' # type into the first textfield
Reply all
Reply to author
Forward
0 new messages