I need to test android app which includes WebView with buttons.
Monkeyrunner works fine for all parts of the app except WebView. Button in WebView just ignores touches from Monkeyrunner. I see that button is clicked because it became grey but then button does nothing. If I use mouse on emulator or finger on real device then button works great.
I see from logcat that touch event was sent to the app but there is no action from the app.
Some code:
final WebView w = (WebView) findViewById(R.id.webView1);
String summary = "<html><body><b>Google</b><form action=http://google.com><input type=submit><input type=text></form></body></html>";
w.loadData(summary, "text/html", null);
Layout:
<Button android:id="@+id/button1" android:text="Click me!" />
<WebView android:id="@+id/webView1" />
Monkeyrunner py:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection(10)
# android.widget.Button COORDINATES - THIS WORKS FINE
device.touch(10,100, 'DOWN_AND_UP')
# WEBVIEW BUTTON COORDINATES - BUTTON DOESN'T WORK
device.touch(200,200, 'DOWN_AND_UP')
I had tried separately DOWN delay UP - the same result. Monkeyrunner from Python or from inside Java do not work too. Flavors and wrappers for monkeyrunner like ChimpChat do not work.
I think it should work because there are so many web/HTML5 apps and it couldn't be true that all of them are not tested. But it appears opposite. Any ideas or suggestions how to enforce touch event for WebView components?