top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Constructing complex UiSelectors in Android

+1 vote
204 views

I am trying to write a UiAutomator test case to check settings to see if Wi-Fi is enabled, and to turn it on if it is not.

The UI hierarchy for the Wi-Fi line in settings looks like:

LinearLayout (the entire Wi-Fi in settings)

--> (0) LinearLayout
----> ImageView (the Wi-Fi icon)
--> (1) LinearLayout
----> TextView ("Wi-Fi")
--> (2) Switch (the Wi-Fi toggle switch

My approach to identifying the correct switch is to find a switch where it's grandparent has a descendant text view containing the text "Wi-Fi".

There doesn't seem to be much information "out there" as to the grammar for constructing complex UiSelectors - can anyone point me in the right direction?

posted Jul 15, 2013 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

Can anyone suggest the library for Push Notification?

0 votes

Update is installed but status is in pending on App Center. Since sync is alreday called , it won't rollback automatically and also not updating to newer version. The app crashes on startup everytime.

So how to rollback or update to new code push bundle version in this case ?

Here is the sample code:

componentDidMount() { 
codePush.sync(codePushOptions,(status) => {  
switch (status) {    
case codePush.SyncStatus.CHECKING_FOR_UPDATE:
//console.log("Checking for updates.");
break;  
case codePush.SyncStatus.DOWNLOADING_PACKAGE:
//console.log("Downloading package.");
break;   
case codePush.SyncStatus.INSTALLING_UPDATE:
//console.log("Installing update.");
break;  
case codePush.SyncStatus.UP_TO_DATE:
break;  
case codePush.SyncStatus.UPDATE_INSTALLED:         
break;
}
})
throw new Error();
}

Note : I have thrown error to check working of auto rollback.

0 votes

Have you even seen OutOfMemoryError in system server? If yes, how do you find the root case of OOM? Do you have any tools that help finding the root cause in production code or during development?

...