Android Espresso: PerformException

前端 未结 7 2058
春和景丽
春和景丽 2020-12-30 22:59

I`m getting

android.support.test.espresso.PerformException: Error performing \'send keyCode: 4, metaState: 0 key event\' on view \'Animations or tra

7条回答
  •  情歌与酒
    2020-12-30 23:26

    In my case, Espresso gave me the "Animations or transitions are not enabled..." error, but that wasn't actually the root cause.

    Scrolling through the stack trace I found this:

    androidx.test.espresso.PerformException: Error performing 'scroll to' on view 'Animations or transitions are enabled on the target device.
    
    ...
    
    Caused by: java.lang.RuntimeException:
      Action will not be performed because the target view does not match one or more
      of the following constraints:
        (view has effective visibility=VISIBLE and is descendant of a: (
          is assignable from class: class android.widget.ScrollView or
          is assignable from class: class android.widget.HorizontalScrollView or
          is assignable from class: class android.widget.ListView
        ))
    Target view: "LinearLayout{...}"
    

    That is, I was trying to scroll something that can't be scrolled.

    So, always read through the stacktrace folks

提交回复
热议问题