LoginSignup
0
0

More than 3 years have passed since last update.

espressoでAlertDialogのsingleChoiceItemsを選択する方法

Posted at

AlertDialogのsetSingleChoiceItemsで設定したアイテムをespressoで選択するには、次のように書けばよい。

onView(withId(R.id.showDialogButton)).perform(click()) // ダイアログを表示
onData(anything())
    .inAdapterView(withClassName(containsString("RecycleListView"))) // はっきりしたクラス名不明なのでcontainsStringを使う
    .atPosition(0) // 先頭の要素を選択
    .perform(click())
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0