Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何登录到fastlane屏幕抓图输出_Android_Android Espresso_Fastlane_Screen Grab - Fatal编程技术网

Android 如何登录到fastlane屏幕抓图输出

Android 如何登录到fastlane屏幕抓图输出,android,android-espresso,fastlane,screen-grab,Android,Android Espresso,Fastlane,Screen Grab,我正在使用fastlanes截图来捕获应用程序的截图。屏幕抓图利用androids ui测试框架espresso浏览应用程序。如果我的一个ui测试失败,我希望其他测试继续捕获屏幕截图,但同时我希望收到失败测试的通知 为了防止测试失败并停止整个程序,我用try/catch包围了所有测试。当测试失败时,我希望将异常记录到屏幕抓图输出: [10:24:37]: Running tests for locale: bs-BA [10:24:37]: $ adb -s emulator-5554 sh

我正在使用fastlanes截图来捕获应用程序的截图。屏幕抓图利用androids ui测试框架espresso浏览应用程序。如果我的一个ui测试失败,我希望其他测试继续捕获屏幕截图,但同时我希望收到失败测试的通知

为了防止测试失败并停止整个程序,我用
try/catch
包围了所有测试。当测试失败时,我希望将异常记录到屏幕抓图输出:

[10:24:37]: Running tests for locale: bs-BA  
[10:24:37]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \  
-e testLocale bs_BA \  
-e endingLocale en_US \  
-e class my.app.tests.MainLocationScreenshots \  
-e isScreengrab true \  
my.app.test/my.app.runners.RxTestRunner  
[10:24:40]: ▸ my.app.tests.MainLocationScreenshots:  
[10:24:41]: ▸ my.app.tests.MainLocationScreenshots:....  
[10:25:37]: ▸ Time: 42.311  
[10:25:37]: ▸ OK (7 tests)  
我尝试了以下方法,但没有成功:

Log.d("", "Can you read this?????????")
Log.d("Screengrab", "Can you read this?")
Log.println(Log.ERROR,"Screengrab","What about this?")
System.out.print("But I bet this works")
所有
Log
调用都出现在Logcat中,但不出现在屏幕抓图输出中,
System.out.print
也不出现在其中

有没有办法记录屏幕抓图的输出?有没有记录在我没看过的地方


谢谢

我看到fastlane本身使用了一个名为UI.rb的类。但是我可以从Java/Android中调用它吗?没有办法从Java调用任何
UI
函数(因为Ruby和Java作为不同的进程运行)。我建议的方法是让测试失败并修复失败的原因,但我不知道将它们包装在try/catch中的具体用例是什么“
如果我的一个ui测试失败,我希望其他测试继续捕获屏幕截图,但同时我希望收到失败测试的通知”
答案是在
Ruby
中这样做,请参见
我建议的方法是让测试失败并修复失败的原因,但我不知道将它们包装在try/catch中的具体用例是什么当我整晚拍摄500多张屏幕截图时,我宁愿返回495张完整的屏幕截图并修复错误后来看到80个截图后运行停止<代码>答案是用Ruby实现
谢谢,我会试试的。