作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在编写一个测试,有可能无法正确加载所有字段。我正在考虑使用简单的 try/catch,但是当我使用
$("select[formcontrolname=\"标识符\"]").shouldBe(禁用);
我得到:
Element should be disabled {input[type="text"]}
Element: '<input class="col-md-8 col-sm-12 col-xs-12 with-tooltip ng-untouched ng-pristine ng-invalid" formcontrolname="identifier" placeholder="e.g. "America" type="text"></input>'
Actual value: enabled
这不是标准异常。我怎样才能捕获它?
最佳答案
您可以捕获任何 Selenide 断言抛出的 AssertionError。
您可能不应该这样做,通常当您的断言在某个超时时间内未得到满足时,您要么有错误,要么有错误的断言。
关于java - 在 Selenide 中捕获 shouldHave/shouldBe 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51440893/
我正在编写一个测试,有可能无法正确加载所有字段。我正在考虑使用简单的 try/catch,但是当我使用 $("select[formcontrolname=\"标识符\"]").shouldBe(禁用
我是一名优秀的程序员,十分优秀!