mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/ConfigurationHelper.java
public static void createFactoryConfig(final WebDriver driver, final String factoryPid, 
            final Map<String, Object> valuesMap) throws InterruptedException
    {
        final WebDriverWait wait = new  WebDriverWait(driver, 10);
        
        //Verify current page and tab before continuing.
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_SYS_CONFIG, 
                CONFIGURATION_TAB_ID);
        
        WebElement configurationPanel = findConfigurationPanel(factoryPid, true);
        if (!configurationPanel.findElement(By.cssSelector("button[id$='createConfigButton']")).isDisplayed())
        {
            configurationPanel.findElement(By.cssSelector("span[class='ui-icon ui-icon-plusthick']")).click();
        }
        
        //Open the create config dialog.
        configurationPanel.findElement(By.cssSelector("button[id$='createConfigButton']")).click();
        
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        WebElement dialogPropTable = fwait.until(new ExpectedCondition<WebElement>()
        {
            @Override
            public WebElement apply(WebDriver driver)
            {
                WebElement propTable = null;
                for (WebElement table: driver.findElements(By.cssSelector("tbody[id$='compositeConfigTable_data']")))
                {
                    if (table.isDisplayed())
                    {
                        propTable = table;
                    }
                }
                wait.until(ExpectedConditions.visibilityOf(propTable));
                return propTable;
            }
        });
       
        for (String key : valuesMap.keySet())
        {
            updateValue(dialogPropTable, key, valuesMap.get(key));
        }
        
        //Create the configuration.
        driver.findElement(By.cssSelector("button[id='createFactoryForm:createConfig']")).click();
        
        GeneralHelper.sleepWithText(5, "Wait for AJAX to update after submitting new configuration");
    }
/**
     * Method used to create a new factory configuration with the specified property values.
     * 
     * @param driver
     *          Instance of the {@link WebDriver} to be used.
     * @param factoryPid
     *          PID of the factory to create a configuration for.
     * @param valuesMap
     *          Map containing the values to be set for the factory configuration. The key is the name of the property
     *          and the value is the string representation of the value to be set for the property.
     */
Method used to create a new factory configuration with the specified property values.

@param driver
Instance of the  WebDriver to be used.
@param factoryPid
PID of the factory to create a configuration for.
@param valuesMap
Map containing the values to be set for the factory configuration. The key is the name of the property
and the value is the string representation of the value to be set for the property.
Method used to create a new factory configuration with the specified property values . @param driver Instance of the WebDriver to be used . @param factoryPid PID of the factory to create a configuration for . @param valuesMap Map containing the values to be set for the factory configuration . The key is the name of the property and the value is the string representation of the value to be set for the property .
public static void createFactoryConfig(final WebDriver driver, final String factoryPid, 
            final Map<String, Object> valuesMap) throws InterruptedException
    {
        final WebDriverWait wait = new  WebDriverWait(driver, 10);
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_SYS_CONFIG, 
                CONFIGURATION_TAB_ID);
        WebElement configurationPanel = findConfigurationPanel(factoryPid, true);
        if (!configurationPanel.findElement(By.cssSelector("button[id$='createConfigButton']")).isDisplayed())
        {
            configurationPanel.findElement(By.cssSelector("span[class='ui-icon ui-icon-plusthick']")).click();
        }
        configurationPanel.findElement(By.cssSelector("button[id$='createConfigButton']")).click();
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        WebElement dialogPropTable = fwait.until(new ExpectedCondition<WebElement>()
        {
            @Override
            public WebElement apply(WebDriver driver)
            {
                WebElement propTable = null;
                for (WebElement table: driver.findElements(By.cssSelector("tbody[id$='compositeConfigTable_data']")))
                {
                    if (table.isDisplayed())
                    {
                        propTable = table;
                    }
                }
                wait.until(ExpectedConditions.visibilityOf(propTable));
                return propTable;
            }
        });
        for (String key : valuesMap.keySet())
        {
            updateValue(dialogPropTable, key, valuesMap.get(key));
        }
        driver.findElement(By.cssSelector("button[id='createFactoryForm:createConfig']")).click();
        GeneralHelper.sleepWithText(5, "Wait for AJAX to update after submitting new configuration");
    }
public static void createFactoryConfig ( final WebDriver driver , final String factoryPid , final Map < String , Object > valuesMap ) throws InterruptedException { final WebDriverWait wait = new WebDriverWait ( driver , 10 ) ; NavigationHelper . pageAndTabCheck ( driver , NavigationButtonNameConstants . NAVBUT_PROP_SYS_CONFIG , CONFIGURATION_TAB_ID ) ; WebElement configurationPanel = findConfigurationPanel ( factoryPid , true ) ; if ( ! configurationPanel . findElement ( By . cssSelector ( "button[id$='createConfigButton']" ) ) . isDisplayed ( ) ) { configurationPanel . findElement ( By . cssSelector ( "span[class='ui-icon ui-icon-plusthick']" ) ) . click ( ) ; } configurationPanel . findElement ( By . cssSelector ( "button[id$='createConfigButton']" ) ) . click ( ) ; Wait < WebDriver > fwait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( StaleElementReferenceException . class , NoSuchElementException . class ) ; WebElement dialogPropTable = fwait . until ( new ExpectedCondition < WebElement > ( ) { @ Override public WebElement apply ( WebDriver driver ) { WebElement propTable = null ; for ( WebElement table : driver . findElements ( By . cssSelector ( "tbody[id$='compositeConfigTable_data']" ) ) ) { if ( table . isDisplayed ( ) ) { propTable = table ; } } wait . until ( ExpectedConditions . visibilityOf ( propTable ) ) ; return propTable ; } } ) ; for ( String key : valuesMap . keySet ( ) ) { updateValue ( dialogPropTable , key , valuesMap . get ( key ) ) ; } driver . findElement ( By . cssSelector ( "button[id='createFactoryForm:createConfig']" ) ) . click ( ) ; GeneralHelper . sleepWithText ( 5 , "Wait for AJAX to update after submitting new configuration" ) ; }
Method used to create a new factory configuration with the specified property values.
Method used to create a new factory configuration with the specified property values .
//Verify current page and tab before continuing. //Open the create config dialog. //Create the configuration.