android.support.v7.widget.RecyclerView:仅当通过appium

时间:2017-11-24 09:06:48

标签: android appium

手动运行app和使用appium之间有什么区别吗?

由于

仅在应用程序由appium启动时才会发生。当手动安装和启动应用程序时,它会正常运行而不会崩溃。

如果我想自动或手动显示一个特定页面,应用程序崩溃“不幸的是,......已停止”

在appium日志中没有任何关于它的错误。在android监视器中只有这个异常:

  

E / AndroidRuntime:致命异常:主程序:...,PID:26842
  java.lang.NullPointerException:尝试从字段读取   ' android.support.v7.widget.RecyclerView $回收站   android.support.v7.widget.RecyclerView.mRecycler'在null对象上   参考        在android.support.v7.widget.RecyclerView $ LayoutManager.onInitializeAccessibilityNodeInfo(RecyclerView.java:9580)        在android.support.v7.widget.RecyclerViewAccessibilityDelegate.onInitializeAccessibilityNodeInfo(RecyclerViewAccessibilityDelegate.java:59)        在android.support.v4.view.AccessibilityDelegateCompat $ AccessibilityDelegateJellyBeanImpl $ 1.onInitializeAccessibilityNodeInfo(AccessibilityDelegateCompat.java:246)        在android.support.v4.view.AccessibilityDelegateCompatJellyBean $ 1.onInitializeAccessibilityNodeInfo(AccessibilityDelegateCompatJellyBean.java:66)        在android.view.View.onInitializeAccessibilityNodeInfo(View.java:6076)        在android.view.View.createAccessibilityNodeInfoInternal(View.java:6037)        在android.view.View $ AccessibilityDelegate.createAccessibilityNodeInfo(View.java:22281)        在android.view.View.createAccessibilityNodeInfo(View.java:6020)        在android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:145)        在android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:119)        在android.view.View.onInitializeAccessibilityEventInternal(View.java:5974)        在android.view.View $ AccessibilityDelegate.onInitializeAccessibilityEvent(View.java:22193)        在android.support.v4.view.AccessibilityDelegateCompatIcs.onInitializeAccessibilityEvent(AccessibilityDelegateCompatIcs.java:97)        在android.support.v4.view.AccessibilityDelegateCompat $ AccessibilityDelegateIcsImpl.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:192)        在android.support.v4.view.AccessibilityDelegateCompat.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:432)        在android.support.v7.widget.RecyclerViewAccessibilityDelegate.onInitializeAccessibilityEvent(RecyclerViewAccessibilityDelegate.java:65)        在android.support.v4.view.AccessibilityDelegateCompat $ AccessibilityDelegateJellyBeanImpl $ 1.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:241)        在android.support.v4.view.AccessibilityDelegateCompatJellyBean $ 1.onInitializeAccessibilityEvent(AccessibilityDelegateCompatJellyBean.java:61)        在android.view.View.onInitializeAccessibilityEvent(View.java:5960)        在android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5827)        在android.view.View $ AccessibilityDelegate.sendAccessibilityEventUnchecked(View.java:22132)        在android.support.v4.view.AccessibilityDelegateCompatIcs.sendAccessibilityEventUnchecked(AccessibilityDelegateCompatIcs.java:122)        在android.support.v4.view.AccessibilityDelegateCompat $ AccessibilityDelegateIcsImpl.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:223)        在android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:371)        在android.support.v4.view.AccessibilityDelegateCompat $ AccessibilityDelegateJellyBeanImpl $ 1.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:268)        在android.support.v4.view.AccessibilityDelegateCompatJellyBean $ 1.sendAccessibilityEventUnchecked(AccessibilityDelegateCompatJellyBean.java:87)        在android.view.View.sendAccessibilityEventUnchecked(View.java:5810)        在android.support.v7.widget.RecyclerView.sendAccessibilityEventUnchecked(RecyclerView.java:3206)        在android.view.View.sendAccessibilityEventInternal(View.java:5789)        在android.view.View $ AccessibilityDelegate.sendAccessibilityEvent(View.java:22090)        在android.support.v4.view.AccessibilityDelegateCompatIcs.sendAccessibilityEvent(AccessibilityDelegateCompatIcs.java:117)        在android.support.v4.view.AccessibilityDelegateCompat $ AccessibilityDelegateIcsImpl.sendAccessibilityEvent(AccessibilityDelegateCompat.java:217)        在android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEvent(AccessibilityDelegateCompat.java:349)   在android.support.v4.view.AccessibilityDelegateComp

我使用appium v​​1.6.5(1.7.1)和Android 6.0 - 7.1模拟器

1 个答案:

答案 0 :(得分:0)

Appium正在使用adb shell来安装/启动应用程序,对于元素交互,它使用UiAutomator / UiAutomator2(取决于您提供的AutomationName功能)

您可以在Appium服务器日志中看到它:

安装apk:

Running '/Users/<user>/Library/Android/sdk/platform-tools/adb'
with args:["-P",5037,"-s","192.168.56.101:5555","shell","ls",
"/data/local/tmp/f0f1ea15bc776c996fddca878b00c589.apk"]

启动应用:

 Running '/Users/<user>/Library/Android/sdk/platform-tools/adb'
 with args: ["-P",5037,"-s","192.168.56.101:5555","shell","am","start",
 "-W","-n","<app_package>/<app_package>.launch.view.LaunchActivity","-S"]

等待预期的活动开始:

Getting focused package and activity
Running '/Users/dmitry/Library/Android/sdk/platform-tools/adb' with args:
["-P",5037,"-s","192.168.56.101:5555","shell","dumpsys","window","windows"]
Found package: <package> and fully qualified activity name : <activity_name>

完成会话创建:

New AndroidDriver session created successfully,
session 807d2f94-bf31-4107-87ca-848261a4ce15 added to master session list

因此,您可以尝试来自终端的相同命令,看看是否可以重现崩溃