mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/GeneralHelper.java
public static void safeClick(final WebElement clickElement)
    {
        WebDriverWait wait = new WebDriverWait(WebDriverFactory.retrieveWebDriver(), MAXIMUM_WAIT_TIME_SECS);
        int retries = 0;
        while (true)
        {
            try
            {
                wait.until(ExpectedConditions.elementToBeClickable(clickElement)).click();
                return;
            }
            catch (StaleElementReferenceException e)
            {
                if (retries < MAX_STALE_ELEMENT_RETRIES)
                {
                    retries++;
                    continue;
                }
                else
                {
                    throw e;
                }
            }
        }
    }
/**
     * Try to click the given element and allow the button to be stale, wait up to 10 seconds and retry up to 5 times.
     */
Try to click the given element and allow the button to be stale, wait up to 10 seconds and retry up to 5 times.
Try to click the given element and allow the button to be stale wait up to 10 seconds and retry up to 5 times .
public static void safeClick(final WebElement clickElement)
    {
        WebDriverWait wait = new WebDriverWait(WebDriverFactory.retrieveWebDriver(), MAXIMUM_WAIT_TIME_SECS);
        int retries = 0;
        while (true)
        {
            try
            {
                wait.until(ExpectedConditions.elementToBeClickable(clickElement)).click();
                return;
            }
            catch (StaleElementReferenceException e)
            {
                if (retries < MAX_STALE_ELEMENT_RETRIES)
                {
                    retries++;
                    continue;
                }
                else
                {
                    throw e;
                }
            }
        }
    }
public static void safeClick ( final WebElement clickElement ) { WebDriverWait wait = new WebDriverWait ( WebDriverFactory . retrieveWebDriver ( ) , MAXIMUM_WAIT_TIME_SECS ) ; int retries = 0 ; while ( true ) { try { wait . until ( ExpectedConditions . elementToBeClickable ( clickElement ) ) . click ( ) ; return ; } catch ( StaleElementReferenceException e ) { if ( retries < MAX_STALE_ELEMENT_RETRIES ) { retries ++ ; continue ; } else { throw e ; } } } }
Try to click the given element and allow the button to be stale, wait up to 10 seconds and retry up to 5 times.
Try to click the given element and allow the button to be stale wait up to 10 seconds and retry up to 5 times .