Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can you provide some more details please e.g.</p> <ul> <li>Which version of adt are you using?</li> <li>Which version of Android are the tests being run in/on?</li> </ul> <p>The reason I ask these questions is because there are some version-specific problems with UIAutomator. For instance I discovered a scrolling problem running on devices with 4.2.2 of Android that seems similar to the one you mentioned. I coded a workaround where my code does the scrolling if the standard Android method doesn't seem to find the element I expect to be available.</p> <p>I've reproduced the essence of my code here, you'll find the complete example at <a href="http://blog.bettersoftwaretesting.com/?p=84" rel="nofollow">http://blog.bettersoftwaretesting.com/?p=84</a></p> <pre><code> // The following loop is to workaround a bug in Android 4.2.2 which // fails to scroll more than once into view. for (int i = 0; i &lt; maxSearchSwipes; i++) { try { appToLaunch = appViews.getChildByText(selector, nameOfAppToLaunch); if (appToLaunch != null) { // Create a UiSelector to find the Settings app and simulate // a user click to launch the app. appToLaunch.clickAndWaitForNewWindow(); break; } } catch (UiObjectNotFoundException e) { System.out.println("Did not find match for " + e.getLocalizedMessage()); } for (int j = 0; j &lt; i; j++) { appViews.scrollForward(); System.out.println("scrolling forward 1 page of apps."); } } </code></pre> <p>Note: I don't know if this code will solve your problem since I don't have an example of your app. If you are able to post your tests and the XML layout of the relevant UI it'd make it easier to diagnose the problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload