【发布时间】:2021-04-11 02:53:06
【问题描述】:
我们如何在 Katalon Studio 中跳过特定的测试用例?
对于我的应用程序,不同的站点具有不同的要求,因此所有功能不会出现在所有站点中。我想让脚本保持动态,所以如果找不到几个链接,我希望脚本跳过一些测试用例。
@Keyword
def ClickonLinkText(String text) {
try {
WebDriver webDriver = DriverFactory.getWebDriver()
KeywordUtil.logInfo("Clicking Link text")
if(webDriver.findElement(By.linkText(text)).click()){
KeywordUtil.logInfo("found")
}else{
KeywordUtil.logInfo("Not found")
// Need to skip the test case if not found!!
}
KeywordUtil.markPassed("Clicked on link text successfully")
} catch (WebElementNotFoundException e) {
KeywordUtil.markFailed("Link text not found")
} catch (Exception e) {
KeywordUtil.markFailed("Fail to click on the Link text")
}
}
【问题讨论】:
标签: groovy automated-tests testcase katalon-studio skip