Example usage for org.openqa.selenium StaleElementReferenceException StaleElementReferenceException

List of usage examples for org.openqa.selenium StaleElementReferenceException StaleElementReferenceException

Introduction

In this page you can find the example usage for org.openqa.selenium StaleElementReferenceException StaleElementReferenceException.

Prototype

public StaleElementReferenceException(String message, Throwable cause) 

Source Link

Usage

From source file:org.alfresco.po.share.site.document.FileDirectoryInfoImpl.java

License:Open Source License

@Override
public ConfirmDeletePage selectDelete() {
    try {/*from   ww  w .j a  v a  2s  .c  o m*/
        WebElement deleteLink = findAndWait(By.cssSelector("div[class$='delete'] a"));
        deleteLink.click();
    } catch (TimeoutException e) {
        throw new PageOperationException("Exceeded time to find the css ", e);
    } catch (StaleElementReferenceException st) {
        throw new StaleElementReferenceException("Unable to find the css ", st);
    }

    return factoryPage.instantiatePage(driver, ConfirmDeletePage.class);
}

From source file:org.alfresco.po.share.site.document.FileDirectoryInfoImpl.java

License:Open Source License

@Override
public HtmlPage selectDeleteLink() {
    try {// w  w  w .j  av a  2  s  .  c  o m
        if (isDeleteLinkDisplayed()) {
            WebElement deleteLink = findAndWait(By.cssSelector(DELETE_LINK));
            deleteLink.click();
        } else {
            throw new NoSuchElementException("Delete Link not visible");
        }
    } catch (TimeoutException e) {
        throw new PageOperationException("Exceeded time to find the css ", e);
    } catch (StaleElementReferenceException st) {
        throw new StaleElementReferenceException("Unable to find the css ", st);
    }

    return factoryPage.getPage(driver);
}