Recording from WebView

Bitbar, the mobile devops company. Logo, large

Hi all,

I would like to present how to implement WebView in your application for good cooperation with Testdroid Recorder.

First issue is, that we can’t handle any events from WebView, if you don’t use own WebClient and don’t override method shouldOverrideUrlLoading with command view.loadUrl(url) For example:

[sourcecode language=”java”]
webView.setWebViewClient(new MyWebViewClient());

private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false; //it doesn’t matter true or false for recording
}
}
[/sourcecode]

If you override this method websites are opened directly in WebView, not in default browser. Anyway, all what we are able to record from WebView are clicks on screen (x, y), drags, send keys and enter texts. I hope this help you testing your application with WebViews.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close