我有以下代码。如果有办法捕获错误并在下拉列表中找不到selectedAVE项目时显示它,请告诉我。
FlexWebDriver
.call(webDriver,
"container_app",
"doFlexClick",
"TreeNodeItem_com.vmware.ebr2.category/_TreeNodeItem_HGroup1/nodeName",
"");
Thread.sleep(SLEEP_TIME);
DropDownList.clickToOpen(webDriver, "vdrCombo");
Thread.sleep(SLEEP_TIME);
FlexMouseEvents.leftClick(webDriver, "automationName=" + selectedAVE);
答案 0 :(得分:0)
您可以使用Try Catch()
来处理运行时异常。
Try{
DropDownList.clickToOpen(webDriver, "vdrCombo");
Thread.sleep(SLEEP_TIME);
FlexMouseEvents.leftClick(webDriver, "automationName=" + selectedAVE);
}catch(Throwable e){
system.out.println(e.getMessage())
}