mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/AssetHelper.java
public static void removeAllAssets(final WebDriver driver) throws InterruptedException
    {
        //Initial page/tab check.
        checkAndCloseAddAssetDialog();
        
        //Create a list of names for all the assets.
        List<String> assetNamesList = new ArrayList<String>();
        for (WebElement asset: driver.findElements(By.cssSelector("table[id$='assetTable']")))
        {
            assetNamesList.add(asset.findElement(By.cssSelector("span[id*='editPanel']")).getText());
        }
        
        //Retrieve a list of all assets and remove them.
        for (final String assetName: assetNamesList)
        {
            WebElement assetToRetrieve = retrieveAsset(driver, assetName);
            
            if (assetToRetrieve != null)
            {
                final String status = 
                        assetToRetrieve.findElement(By.cssSelector("span[id*='assetActiveStatus']")).getText();
                // Check if asset is not deactivated, try to deactivate so it can be removed. If 
                // activating/deactivating, try anyways just in case.
                if (!status.equals("DEACTIVATED"))
                {
                    AssetHelper.deactivateAsset(driver, assetName);
                }
                //Attempt to remove specified asset.
                AssetHelper.removeAsset(driver, assetName);
            }
            else
            {
                LOG.log(Level.INFO, String.format(
                        "Cannot find asset [%s] when trying to remove it from the list.", assetName));
            }
        }
    }
/**
     * Method that removes all assets found on the asset page.
     * @param driver
     *      Instance of the {@link WebDriver} to be used.
     */
Method that removes all assets found on the asset page.
@param driver
Instance of the  WebDriver to be used.
Method that removes all assets found on the asset page . @param driver Instance of the WebDriver to be used .
public static void removeAllAssets(final WebDriver driver) throws InterruptedException
    {
        checkAndCloseAddAssetDialog();
        List<String> assetNamesList = new ArrayList<String>();
        for (WebElement asset: driver.findElements(By.cssSelector("table[id$='assetTable']")))
        {
            assetNamesList.add(asset.findElement(By.cssSelector("span[id*='editPanel']")).getText());
        }
        for (final String assetName: assetNamesList)
        {
            WebElement assetToRetrieve = retrieveAsset(driver, assetName);
            if (assetToRetrieve != null)
            {
                final String status = 
                        assetToRetrieve.findElement(By.cssSelector("span[id*='assetActiveStatus']")).getText();
                if (!status.equals("DEACTIVATED"))
                {
                    AssetHelper.deactivateAsset(driver, assetName);
                }
                AssetHelper.removeAsset(driver, assetName);
            }
            else
            {
                LOG.log(Level.INFO, String.format(
                        "Cannot find asset [%s] when trying to remove it from the list.", assetName));
            }
        }
    }
public static void removeAllAssets ( final WebDriver driver ) throws InterruptedException { checkAndCloseAddAssetDialog ( ) ; List < String > assetNamesList = new ArrayList < String > ( ) ; for ( WebElement asset : driver . findElements ( By . cssSelector ( "table[id$='assetTable']" ) ) ) { assetNamesList . add ( asset . findElement ( By . cssSelector ( "span[id*='editPanel']" ) ) . getText ( ) ) ; } for ( final String assetName : assetNamesList ) { WebElement assetToRetrieve = retrieveAsset ( driver , assetName ) ; if ( assetToRetrieve != null ) { final String status = assetToRetrieve . findElement ( By . cssSelector ( "span[id*='assetActiveStatus']" ) ) . getText ( ) ; if ( ! status . equals ( "DEACTIVATED" ) ) { AssetHelper . deactivateAsset ( driver , assetName ) ; } AssetHelper . removeAsset ( driver , assetName ) ; } else { LOG . log ( Level . INFO , String . format ( "Cannot find asset [%s] when trying to remove it from the list." , assetName ) ) ; } } }
Method that removes all assets found on the asset page.
Method that removes all assets found on the asset page .
//Initial page/tab check. //Create a list of names for all the assets. //Retrieve a list of all assets and remove them. // Check if asset is not deactivated, try to deactivate so it can be removed. If  // activating/deactivating, try anyways just in case. //Attempt to remove specified asset.