mardi 28 août 2018

Selenium : wait until attribute value changed

I have below image in webpage whose src is changed after some time(time can vary) < src="/src/theme/running.png" alt="running"> after some time it will change to

I have added below code to wait until src is changed but its not working and giving error "

WebDriverWait wait = new WebDriverWait(driver, 120);
wait.until(
                ExpectedConditions.attributeToBe(image_src, "src",img_src_success );

                );
where image_src = WebElement 
src = attribute
img_src_success = String value "/src/image/success.png"

Above code is giving error org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document.

Please suggest what I m doing wrong or any other way to do this.

Aucun commentaire:

Enregistrer un commentaire