Appium appium 1.8.0+java 同时运行多个 case 时,怎么实现一个 case 运行失败其他 case 继续运行?

我喜欢的K17 · July 20, 2018 · Last by 我喜欢的K17 replied at July 20, 2018 · 1345 hits
public class Download extends DownloadUI{

  @BeforeTest
  public void setup_test() throws Exception {
      setup();
      Thread.sleep(5000);
      location();
  }
  //下载一个文件
  @Test
  public void dropbuttondown() throws Exception{
      restartAS();
      inappium();
      drop();
      clearlist();
      System.out.println("dropbuttondown done");
  }
  //全选下载目录的所有文件
  @Test
  public void morefilesdown() throws Exception{
      restartAS();
      inappium();
      morefiles();
      clearlist();
      System.out.println("morefilesdown done");
  }

上面的代码是在一个类里同时运行两个 case,如果第一个出错了第二个也就不继续了,怎么实现 case 的独立性,错误抛出后继续运行下一个 case 呢?

共收到 3 条回复 时间 点赞

和 testng 类似的做法都可以,case 单独放,用配置文件管理 case 就可以了。

tracy 回复

好的,谢谢,我先去尝试一下,对 testng 才开始接触

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up