TA的每日心情 | 无聊 4 天前 |
---|
签到天数: 530 天 连续签到: 2 天 [LV.9]测试副司令
|
1测试积点
问题:
1、直接运行用例时,可以正常运行,日志如下:
- [debug] [UiAutomator] Shutting down UiAutomator
- [debug] [UiAutomator] Moving to state 'stopping'
- [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 24.758
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
- [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
- [debug] [UiAutomator] UiAutomator shut down normally
- [debug] [UiAutomator] Moving to state 'stopped'
复制代码 2、但是以这种方式运行os.popen("python case.py"),用例执行失败,日志如下:
- [debug] [AndroidBootstrap] Received command result from bootstrap
- [debug] [UiAutomator] Shutting down UiAutomator
- [debug] [UiAutomator] Moving to state 'stopping'
- [debug] [UiAutomator] UiAutomator shut down normally
- [debug] [UiAutomator] Moving to state 'stopped'
复制代码 3、后来实验发现有种方式可以让第2种方式成功运行:
- def ur(a):
- if a == 1:
- os.popen("python case.py")
- pid = os.getpid()
- os.kill(pid=pid, sig=signal.SIGKILL)
- elif a == 2:
- os.popen("adb logcat")
- pool = ThreadPool(4)
- lists = list([1, 2])
- pool.map(ur, lists)
- pool.close()
- pool.join()
复制代码
请注意:必须要这种持续运行的adb命令才行os.popen("adb logcat"),如果把"adb logcat"换成"adb devices"或者非adb命令都还是会失败。 以上都是一行一行的对比用例执行成功和失败的appium的日志发现的区别。 求原因。。。。。。谢谢!
|
|