mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/CommsAddDialogHelper.java
public static void putInForceAddPhysicalLinkMode(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 10);

        // ensure that the Physical Link tab is open
        CommsAddDialogHelper.layerSelectHelper(driver, "Physical Link", null);

        // go to force-add physical link type list
        WebElement forceAddCheckBox = driver.findElement(
                By.cssSelector("input[id$='addAccordion:forceAddCheckBox_input']"));
        wait.until(ExpectedConditions.visibilityOf(forceAddCheckBox));
        forceAddCheckBox.click();

        // Wait till the link tab is no longer available. This means that force add physical link dialog is displayed.
        Wait<WebDriver> linkTabWait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).pollingEvery(
                2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, StaleElementReferenceException.class);

        linkTabWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                try
                {
                    driver.findElement(By.id("addCommsForm:addAccordion:linkTab"));
                }
                catch (NoSuchElementException exception)
                {
                    return true;
                }
                return false;
            }
        });
    }
/**
     * Method used to put the create comm stack dialog into the force add physical link mode.
     * 
     * @param driver
     *            Web driver to be used.
     */
Method used to put the create comm stack dialog into the force add physical link mode.

@param driver
Web driver to be used.
Method used to put the create comm stack dialog into the force add physical link mode . @param driver Web driver to be used .
public static void putInForceAddPhysicalLinkMode(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 10);
        CommsAddDialogHelper.layerSelectHelper(driver, "Physical Link", null);
        WebElement forceAddCheckBox = driver.findElement(
                By.cssSelector("input[id$='addAccordion:forceAddCheckBox_input']"));
        wait.until(ExpectedConditions.visibilityOf(forceAddCheckBox));
        forceAddCheckBox.click();
        Wait<WebDriver> linkTabWait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).pollingEvery(
                2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, StaleElementReferenceException.class);
        linkTabWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                try
                {
                    driver.findElement(By.id("addCommsForm:addAccordion:linkTab"));
                }
                catch (NoSuchElementException exception)
                {
                    return true;
                }
                return false;
            }
        });
    }
public static void putInForceAddPhysicalLinkMode ( final WebDriver driver ) throws InterruptedException { WebDriverWait wait = new WebDriverWait ( driver , 10 ) ; CommsAddDialogHelper . layerSelectHelper ( driver , "Physical Link" , null ) ; WebElement forceAddCheckBox = driver . findElement ( By . cssSelector ( "input[id$='addAccordion:forceAddCheckBox_input']" ) ) ; wait . until ( ExpectedConditions . visibilityOf ( forceAddCheckBox ) ) ; forceAddCheckBox . click ( ) ; Wait < WebDriver > linkTabWait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( NoSuchElementException . class , StaleElementReferenceException . class ) ; linkTabWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { try { driver . findElement ( By . id ( "addCommsForm:addAccordion:linkTab" ) ) ; } catch ( NoSuchElementException exception ) { return true ; } return false ; } } ) ; }
Method used to put the create comm stack dialog into the force add physical link mode.
Method used to put the create comm stack dialog into the force add physical link mode .
// ensure that the Physical Link tab is open // go to force-add physical link type list // Wait till the link tab is no longer available. This means that force add physical link dialog is displayed.