有一个问题,突然之前基于appium的Android应用程序selenium测试已停止工作(一直成功)。
问题特别与appium启动应用程序有关(应用程序始终在使用物理用户输入打开时启动...)。基本上应用程序启动,加载屏幕出现然后崩溃。这种情况大部分发生在但并非总是如此。我发现重新启动手机后通常可以正常工作。但是,它会在后续运行中崩溃。
非常感谢任何帮助。尝试了许多事情/在线搜索,但这一切都无济于事。
这是appium输出:
[AndroidDriver] Parsed pid: '27608' pkg: 'com.dedsert.betbright.uat' from
[AndroidDriver] USER PID PPID VSIZE RSS WCHAN PC NAME
[AndroidDriver] u0_a236 27608 4736 3621124 393160 0 0000000000 R com.dedsert.betbright.uat
[AndroidDriver] Returning process name: 'com.dedsert.betbright.uat'
[AndroidDriver] Found webviews: ["WEBVIEW_com.dedsert.betbright.uat"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.dedsert.betbright.uat"]
[MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context 200 245 ms - 76
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.StackOverflowError
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_RESULT: longMsg=stack size 1037KB
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_CODE: 0
[UiAutomator] UiAutomator exited unexpectedly with code 4294967295, signal null
[UiAutomator] Moving to state 'stopped'
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was 'UiAUtomator shut down unexpectedly'
[Appium] Removing session a9457315-d657-4fd1-bdf0-36fe5d76b3c5 from our master session list
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","am","force-stop","com.dedsert.betbright.uat"]
[ADB] Pressing the HOME button
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","input","keyevent",3]
[AndroidBootstrap] Cannot shut down Android bootstrap; it has already shut down
[Logcat] Stopping logcat capture
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[HTTP] --> POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context {"name":"WEBVIEW_com.dedsert.betbright.uat"}
[HTTP] <-- POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context 404 1 ms - 131
在IntelliJ方面看不到很多 - 确实在给出的堆栈跟踪中发现了这一点:
org.openqa.selenium.remote.SessionNotFoundException: A session is either terminated or not started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 5 milliseconds
答案 0 :(得分:0)
看起来您的手机内存不足。清除测试手机的缓存可能是值得的:
来自(步骤4)的信息:https://fossbytes.com/clear-android-cache-data-quick-methods/
答案 1 :(得分:0)
卸载appium并重新安装appium,它将为您工作。 从命令行。
npm uninstall -g appium
重新安装appium。
npm install -g appium