爲什麼dosnt我的方法趕上我'超時異常'並打印到控制檯?爲什麼dosnt我的方法趕上我'超時異常'並打印到控制檯?
public void clickDrivingExperienceButton() throws Exception {
boolean test = this.wait.until(ExpectedConditions.elementToBeClickable(link_DrivingExperiences)).isEnabled();
try {
if (test == true) {
link_DrivingExperiences.click();
}
System.out.println("Successfully clicked on the driving experience button, using locator: " + "<" + link_DrivingExperiences.toString() + ">");
}catch (TimeoutException e) {
System.out.println("WHY DONT I PRINT ANYTHING??????" + e.getMessage());
}catch (Exception e) {
System.out.println("Unable to click on the Driving Experience Button, Exception: " + e.getMessage());
} finally {
// final code here
}
}
如果你發佈完整的堆棧跟蹤,它會更清晰地發生線路異常 –