我正在尝试等待加载的图像从屏幕上消失
如果屏幕未加载,则元素看起来像:: >>
<div id="divWait" style="cursor: wait; position: absolute; left: 0%; top: 0%; background: transparent; padding: 3px; width: 100%; height: 100%; display: none;" xpath="1">
当屏幕加载时,元素看起来像:
<div id="divWait" style="cursor: wait; position: absolute; left: 0%; top: 0%; background: transparent; padding: 3px; width: 100%; height: 100%; " xpath="1">
display
消失
我为此编写的代码行:
w.until(ExpectedConditions.attributeContains(driver.findElement(By.xpath("//*[@id=\"divWait\"]")), "display", "none"));
值得一提的是,我的元素位于
iframe
中,但是我已经处理并确保可以解析iframe中的其他元素,还确保了上面使用的xpath有效(从html复制为xpath)
其他时候我遇到以下异常
stale element reference: element is not attached to the page document
我正尝试等待加载的图像从屏幕上消失,如果屏幕未加载,则该元素看起来像:
陈旧元素引用错误是由于引用的Web元素不再附加到DOM而发生的Web驱动程序错误。