Xi Zhang Xi Zhang - 3 days ago 6
Android Question

Scroll a webview in Robotium?

How to automatically scroll a WebView down to bottom in Robotium?

We use a WebView to disaply EULA by the way.

Answer

I've found that clicking on the view, then pressing the Down key some set number of times can do what you want. So something like:

solo.clickOnView(getActivity().findViewById(R.id.your_eula_webview_id));
for (int i=0;i<20;i++) {
    solo.sendKey(Solo.DOWN);
}

If that doesn't work, try finding something that does using the keyboard on the emulator, and then do the same with Robotium.

Comments