android / android/testing-samples
Native NullReferenceException thrown on ByMatcher.java:142 when using Android 4.4.x devices.
- Langage dominant
- Java
- Étoiles
- 9.3k
- Forks
- 3.6k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi everyone,
I'm trying to include an Android 4 device for my Automation suite, but for some reason I'm seeing NullReference exceptions when interacting with certain textboxes in an app under test but ONLY when using pre-Android 5 devices.
The stack traces I'm seeing are as follows:
`java.lang.NullPointerException
at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:142)
at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:111)
at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:96)
at android.support.test.uiautomator.UiDevice.findObjects(UiDevice.java:171)`
when using FindObjects method to look for the textbox in question or:
`java.lang.NullPointerException
at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:142)
at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:111)
at android.support.test.uiautomator.ByMatcher.findMatch(ByMatcher.java:72)
at android.support.test.uiautomator.UiDevice.hasObject(UiDevice.java:154)
at android.support.test.uiautomator.Until$2.apply(Until.java:55)
at android.support.test.uiautomator.Until$2.apply(Until.java:52)
at android.support.test.uiautomator.WaitMixin.wait(WaitMixin.java:40)
at android.support.test.uiautomator.WaitMixin.wait(WaitMixin.java:34)
at android.support.test.uiautomator.UiDevice.wait(UiDevice.java:187)`
when using phone.wait(Until.hasObject(By.res(identifier)), timer); for example.
Any clues on how to bypass this issue? I'm not sure if our App developers are doing something strange with these textboxes or early Android versions are just poorly supported by UiAutomator.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire l’échec sur un appareil antérieur à Android 5 via UiDevice.findObjects et wait(Until.hasObject(By.res(identifier))). Examinez ensuite ByMatcher.java:142 et ses appelants afin de déterminer pourquoi la valeur null apparaît ; le travail est considéré comme terminé lorsqu’un contournement fiable est documenté ou qu’un correctif validé par rapport aux deux chemins d’appel concernés est fourni.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, java
- Domaine
- mobile, testing
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100