【问题标题】:How to handle Application “Crash” when Run Test Suite.(Android)运行测试套件时如何处理应用程序“崩溃”。(Android)
【发布时间】:2019-07-29 00:09:53
【问题描述】:

关于在模拟器上运行测试套件(带有 20-30 个测试用例)时应用程序在运行 6-7 个测试用例后崩溃,它在我们在物理设备上执行时工作。但我们必须使用模拟器,我们使用的是 Android 模拟器和 Genymotion。

【问题讨论】:

    标签: automation appium appium-android katalon-studio test-suite


    【解决方案1】:

    @lav Sharma,请您在这里扩展一下:

    • 您使用什么 .apk 版本来执行?调试还是非调试?

    • 第二点,请你玩一下标志setWebContentsDebuggingEnabled 并要求开发者打开它WebView.setWebContentsDebuggingEnabled(true);

    或关闭WebView.setWebContentsDebuggingEnabled(false);

    在app的onCreate方法中;

    • 为了调查问题 - 请收集应用程序日志(在测试执行期间)并在此处发布异常。要转储日志 - 请使用以下方法:

      List<LogEntry> logs = driver.manage().logs().get("logcat").getAll();
      

      public static void dumpLogs(AppiumDriver driver, String testName) { String logPath = "C:\\automation_capture\\"; log.info("{}: Saving device log...", driver.getSessionId()); List<LogEntry> logEntries = driver.manage().logs().get("logcat").filter(Level.ALL); File logFile = new File(String.format("%s_%s.txt",logPath,testName)); PrintWriter log_file_writer = new PrintWriter(logFile); log_file_writer.println(logEntries ); log_file_writer.flush(); log.info("{}: Saving device log - Done.",driver.getSessionId()); } }

    希望这会有所帮助。 最好的祝福, 尤金

    【讨论】:

      猜你喜欢
      • 2015-04-04
      • 1970-01-01
      • 1970-01-01
      • 2016-10-11
      • 1970-01-01
      • 1970-01-01
      • 2016-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多