目前遇到的弹框有两种,一种是alert,一种是div,如果遇到div模拟的弹框,在用alert就不行了。

1.

    public static Alert getAlert(WebDriver dr) {
        try{
            Alert alert = dr.switchTo().alert();
            return alert;
        }catch(NoAlertPresentException e) {
            System.out.println("alert not Exist");
            return null;
        }
    }

2.div

用findelement定位弹框

相关文章:

  • 2022-12-23
  • 2021-07-12
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-11-25
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
相关资源
相似解决方案