mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/AssetHelper.java
public static WebElement retrieveAssetType(final WebDriver driver, final String assetTypeName)
    {
        //Retrieve the list of all asset types and search for an asset type with the specified name.
        int assetTypeCount = -1;
        int tempCount = 0;
        while (assetTypeCount != (tempCount = driver.findElements(By.cssSelector("a[id*='assetTypeList']")).size()))
        {
            assetTypeCount = tempCount;

            try
            {
                // Allow a small amount of time for the asset list to update and then check size again
                Thread.sleep(1000);
            }
            catch (InterruptedException e)
            {
                throw new IllegalStateException(e);
            }
        }

        for (int assetTypeIdx = 0; assetTypeIdx < assetTypeCount; assetTypeIdx++)
        {
            WebElement assetType = GeneralHelper.scrollElementIntoView(
                    By.cssSelector(String.format("a[id*='assetTypeList:%d']", assetTypeIdx)));

            if (assetType.getText().contains(assetTypeName))
            {
                return assetType;
            }
        }
        return null;
    }
/**
     * Method that finds and returns the WebElement that represents the specified asset type on the add asset dialog.
     * This method returns null if the specified asset type cannot be found.
     * 
     * @param driver
     *      Instance if the {@link WebDriver} the asset type will be retrieved from.
     * @param assetTypeName
     *      Name of the asset type to be retrieved. 
     * @return
     *      {@link WebElement} that represents the specified asset type or <code>null</code> if it cannot be found.
     */
Method that finds and returns the WebElement that represents the specified asset type on the add asset dialog.
This method returns null if the specified asset type cannot be found.

@param driver
Instance if the  WebDriver the asset type will be retrieved from.
@param assetTypeName
Name of the asset type to be retrieved.
@return
WebElement that represents the specified asset type or null if it cannot be found.
Method that finds and returns the WebElement that represents the specified asset type on the add asset dialog . This method returns null if the specified asset type cannot be found . @param driver Instance if the WebDriver the asset type will be retrieved from . @param assetTypeName Name of the asset type to be retrieved . @return WebElement that represents the specified asset type or null if it cannot be found .
public static WebElement retrieveAssetType(final WebDriver driver, final String assetTypeName)
    {
        int assetTypeCount = -1;
        int tempCount = 0;
        while (assetTypeCount != (tempCount = driver.findElements(By.cssSelector("a[id*='assetTypeList']")).size()))
        {
            assetTypeCount = tempCount;
            try
            {
                Thread.sleep(1000);
            }
            catch (InterruptedException e)
            {
                throw new IllegalStateException(e);
            }
        }
        for (int assetTypeIdx = 0; assetTypeIdx < assetTypeCount; assetTypeIdx++)
        {
            WebElement assetType = GeneralHelper.scrollElementIntoView(
                    By.cssSelector(String.format("a[id*='assetTypeList:%d']", assetTypeIdx)));
            if (assetType.getText().contains(assetTypeName))
            {
                return assetType;
            }
        }
        return null;
    }
public static WebElement retrieveAssetType ( final WebDriver driver , final String assetTypeName ) { int assetTypeCount = - 1 ; int tempCount = 0 ; while ( assetTypeCount != ( tempCount = driver . findElements ( By . cssSelector ( "a[id*='assetTypeList']" ) ) . size ( ) ) ) { assetTypeCount = tempCount ; try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { throw new IllegalStateException ( e ) ; } } for ( int assetTypeIdx = 0 ; assetTypeIdx < assetTypeCount ; assetTypeIdx ++ ) { WebElement assetType = GeneralHelper . scrollElementIntoView ( By . cssSelector ( String . format ( "a[id*='assetTypeList:%d']" , assetTypeIdx ) ) ) ; if ( assetType . getText ( ) . contains ( assetTypeName ) ) { return assetType ; } } return null ; }
Method that finds and returns the WebElement that represents the specified asset type on the add asset dialog.
Method that finds and returns the WebElement that represents the specified asset type on the add asset dialog .
//Retrieve the list of all asset types and search for an asset type with the specified name. // Allow a small amount of time for the asset list to update and then check size again