mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/observation/ObservationFilterHelper.java
private static WebElement isWebElementVisible(final WebDriver driver, 
            final String elementId) throws InterruptedException
    {
        final WebElement accordion = retrieveFilterAccordionPanel(driver);
        
        WebElement elementToCheck = accordion.findElement(By.cssSelector(elementId));
        
        //checks to see if retrieve button is visible. if not expand the accordion
        if (!elementToCheck.isDisplayed())
        {
            Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                    pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                            NoSuchElementException.class);
            
            //click filter button
            fwait.until(new ExpectedCondition<Boolean>()
            {
                @Override
                public Boolean apply(WebDriver driver)
                {
                    try
                    {
                        clickRetrieveDeleteAccordionPanel(driver, ExpandCollapse.EXPAND);
                    }
                    catch (InterruptedException e)
                    {
                        //might happen, this is an inner class def gotta catch it
                    }
                    return  accordion.findElement(By.cssSelector(elementId)).isDisplayed();
                }
            });
            
            return accordion.findElement(By.cssSelector(elementId));
        }
        
        return elementToCheck;
    }
/**
     * Method used to determine if the specified element is currently visible.
     * 
     * @param driver
     *      {@link WebDriver} currently in use for running the tests.
     * @param elementId
     *      The string value used to retrieve an element with a css selector.
     * @return
     *      The web element that was being checked for visibility.
     */
Method used to determine if the specified element is currently visible.

@param driver
WebDriver currently in use for running the tests.
@param elementId
The string value used to retrieve an element with a css selector.
@return
The web element that was being checked for visibility.
Method used to determine if the specified element is currently visible . @param driver WebDriver currently in use for running the tests . @param elementId The string value used to retrieve an element with a css selector . @return The web element that was being checked for visibility .
private static WebElement isWebElementVisible(final WebDriver driver, 
            final String elementId) throws InterruptedException
    {
        final WebElement accordion = retrieveFilterAccordionPanel(driver);
        WebElement elementToCheck = accordion.findElement(By.cssSelector(elementId));
        if (!elementToCheck.isDisplayed())
        {
            Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                    pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                            NoSuchElementException.class);
            fwait.until(new ExpectedCondition<Boolean>()
            {
                @Override
                public Boolean apply(WebDriver driver)
                {
                    try
                    {
                        clickRetrieveDeleteAccordionPanel(driver, ExpandCollapse.EXPAND);
                    }
                    catch (InterruptedException e)
                    {
                    }
                    return  accordion.findElement(By.cssSelector(elementId)).isDisplayed();
                }
            });
            return accordion.findElement(By.cssSelector(elementId));
        }
        return elementToCheck;
    }
private static WebElement isWebElementVisible ( final WebDriver driver , final String elementId ) throws InterruptedException { final WebElement accordion = retrieveFilterAccordionPanel ( driver ) ; WebElement elementToCheck = accordion . findElement ( By . cssSelector ( elementId ) ) ; if ( ! elementToCheck . isDisplayed ( ) ) { Wait < WebDriver > fwait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( StaleElementReferenceException . class , NoSuchElementException . class ) ; fwait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { try { clickRetrieveDeleteAccordionPanel ( driver , ExpandCollapse . EXPAND ) ; } catch ( InterruptedException e ) { } return accordion . findElement ( By . cssSelector ( elementId ) ) . isDisplayed ( ) ; } } ) ; return accordion . findElement ( By . cssSelector ( elementId ) ) ; } return elementToCheck ; }
Method used to determine if the specified element is currently visible.
Method used to determine if the specified element is currently visible .
//checks to see if retrieve button is visible. if not expand the accordion //click filter button //might happen, this is an inner class def gotta catch it