【发布时间】:2018-07-09 03:54:51
【问题描述】:
.isDisplayed()--> 从不返回 False 为什么?尽管我使用的是 try catch 块,但它总是不给出这样的元素异常。
try {
boolean status_second= Appointment_Booking_page.second_confirmation.isDisplayed();
System.out.println("Current Second Appointment booking status-->" + status_second);
}
catch (NoSuchElementException e) {
}
请提出相同的建议。
【问题讨论】:
-
如果没有出现这样的元素异常,则该对象不在页面上,或者您使用了错误的定位器值。检查您的 xpath 或您使用的任何定位器。有时,元素未加载,您可能需要等待元素可见。
标签: selenium selenium-webdriver