android / android/testing-samples

UiObject2 referring to wrong element

オープン
#113 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
not sample issue
主要言語
Java
スター
9.3k
フォーク
3.6k
PR マージ指標
30日以内にマージされた PR はありません

説明

Referring to previously created `UiObject2` object which is not exist in the screen (in the same activity) pointing to a random element instead of throwing `StaleObjectException`.

Example code snippet:

```
UiObject2 elementInScrollView = mDevice.findObject(By.desc("Auto Complete"));
elementInScrollView.getText();
//returns "Auto Complete"

//scroll down to make sure that "Auto Complete" not present in the screen
mDevice.swipe(100, 400, 100, 50, 100);

elementInScrollView.getText();
//returns some random element text in the screen ex: List

mDevice.pressBack();
elementInScrollView.getText();
//throws `StaleObjectException`
```

Device API Level: 23
AUT: API Demos(Inbuilt app)

I suspect something wrong to `AccessibilityNodeInfo` [here](https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/accessibility/AccessibilityNodeInfo.java#L772) when `getAccessibilityNodeInfo` called from [UiObject2](https://android.googlesource.com/platform/frameworks/uiautomator/+/android-support-test/src/main/java/android/support/test/uiautomator/UiObject2.java#625)

PFA screenshot for the functional understanding.

![uiobject2 issue](https://cloud.githubusercontent.com/assets/4507565/19114424/8fc47cc2-8b2b-11e6-94d6-3c8925193213.png)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

API Demos の例と、レポートにリンクされている既存の UiObject2 および AccessibilityNodeInfo コードを使用して、API level 23 での動作を再現します。以前に見つかったオブジェクトがスクロール後に別の要素を返す理由を確認します。存在しないオブジェクトが無関係なテキストを返すのではなく StaleObjectException をスローすれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, java
領域
mobile, testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。