【发布时间】:2020-05-15 15:09:29
【问题描述】:
我正在尝试使用 selenium 中的 xpath 单击以下按钮,
<div class="bg-iconButton-button bg-common-nodrag bg-tool-maximize bg-common-hideDisplay" title="Display in full screen" id="bg-po-full-screen-1"></div>
我试过下面的代码,
fullscreenbutton=UtilityFunc.driver.findElement(By.xpath("//*[@id='bg-po-full-screen-1']"));
KeywordFunc.fnClick(fullscreenbutton);
我收到以下错误,
org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attach to the page document
我想我正面临这个问题,因为它被封闭为一个 div 而不是按钮。
【问题讨论】:
标签: java selenium selenium-webdriver xpath