Reload DOM element in selenium webdriver after some new tag added [duplicate]

余生颓废 提交于 2019-12-25 18:48:13

问题


In my web page, when I click OK button, some HTML tag will be added in current page source for display popup (the URL is not changed).
How can I get new web element from current page?


回答1:


You can use explicit wait to wait for the element to be added to the DOM

WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.id("newElementId")));


来源:https://stackoverflow.com/questions/54214334/reload-dom-element-in-selenium-webdriver-after-some-new-tag-added

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!