OverviewSince version 2.4, TestDroid Recorder does not record simple clicks as x,y positions in the WebView but it is able to look inside the html code of the WebView, analyse the code, and record actions based on html elements. It's a very important feature as more and more applications are implemented using partly HTML as well as many applications use WebView to implement for example the login view.
Recorded and manual commandsWe are recording the following commands from WebView:
- clickOnHtmlElement(tag, id, name, class, index, custom_attributes...)
- enterTextIntoHtmlElement(tag, id, name, class, text, index, custom_attributes...)
- waitForHtmlElement(tag, id, name, class, index, time, custom_attributes...)
- elementExistsOnHtmlPage(tag, id, name, class, index, custom_attributes...)
We also provide a few auxiliary method:
- getHtmlCode - to get whole html code from WebView - needed to manuall use it inside result code
Playback WebView testsIf you want to use this feature, there are couple of points you should be aware of:
- If you record your test on device with Android 4.1 you need to have a WebViewClient connected to your WebView.