mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/AssetHelper.java
public static void checkAndCloseAddAssetDialog() throws InterruptedException
    {
        final WebDriver driver = WebDriverFactory.retrieveWebDriver();
        
        //Initial page/tab check.
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_ASSETS, ASSET_CONFIG_TAB_ID);
        
        final By addAssetDialogSelector = By.cssSelector("div[id='addAssetDialog']");
        final WebElement addAssetDialog = driver.findElement(addAssetDialogSelector);
        
        if (addAssetDialog.isDisplayed())
        {
            final WebElement closeDialogButton = 
                    addAssetDialog.findElement(By.cssSelector("span[class='ui-icon ui-icon-closethick']"));
            closeDialogButton.click();
            
            final WebDriverWait wait = new WebDriverWait(driver, 30);
            wait.ignoring(NoSuchElementException.class, StaleElementReferenceException.class);
            wait.until(ExpectedConditions.invisibilityOfElementLocated(addAssetDialogSelector));
            
            //Wait just to ensure that the dialog box has closed and won't obstruct any other actions.
            Thread.sleep(500);
        }
    }
/**
     * Function that ensures that add asset dialog is closed.
     */
Function that ensures that add asset dialog is closed.
Function that ensures that add asset dialog is closed .
public static void checkAndCloseAddAssetDialog() throws InterruptedException
    {
        final WebDriver driver = WebDriverFactory.retrieveWebDriver();
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_ASSETS, ASSET_CONFIG_TAB_ID);
        final By addAssetDialogSelector = By.cssSelector("div[id='addAssetDialog']");
        final WebElement addAssetDialog = driver.findElement(addAssetDialogSelector);
        if (addAssetDialog.isDisplayed())
        {
            final WebElement closeDialogButton = 
                    addAssetDialog.findElement(By.cssSelector("span[class='ui-icon ui-icon-closethick']"));
            closeDialogButton.click();
            final WebDriverWait wait = new WebDriverWait(driver, 30);
            wait.ignoring(NoSuchElementException.class, StaleElementReferenceException.class);
            wait.until(ExpectedConditions.invisibilityOfElementLocated(addAssetDialogSelector));
            Thread.sleep(500);
        }
    }
public static void checkAndCloseAddAssetDialog ( ) throws InterruptedException { final WebDriver driver = WebDriverFactory . retrieveWebDriver ( ) ; NavigationHelper . pageAndTabCheck ( driver , NavigationButtonNameConstants . NAVBUT_PROP_ASSETS , ASSET_CONFIG_TAB_ID ) ; final By addAssetDialogSelector = By . cssSelector ( "div[id='addAssetDialog']" ) ; final WebElement addAssetDialog = driver . findElement ( addAssetDialogSelector ) ; if ( addAssetDialog . isDisplayed ( ) ) { final WebElement closeDialogButton = addAssetDialog . findElement ( By . cssSelector ( "span[class='ui-icon ui-icon-closethick']" ) ) ; closeDialogButton . click ( ) ; final WebDriverWait wait = new WebDriverWait ( driver , 30 ) ; wait . ignoring ( NoSuchElementException . class , StaleElementReferenceException . class ) ; wait . until ( ExpectedConditions . invisibilityOfElementLocated ( addAssetDialogSelector ) ) ; Thread . sleep ( 500 ) ; } }
Function that ensures that add asset dialog is closed.
Function that ensures that add asset dialog is closed .
//Initial page/tab check. //Wait just to ensure that the dialog box has closed and won't obstruct any other actions.