Example usage for org.openqa.selenium Keys DOWN

List of usage examples for org.openqa.selenium Keys DOWN

Introduction

In this page you can find the example usage for org.openqa.selenium Keys DOWN.

Prototype

Keys DOWN

To view the source code for org.openqa.selenium Keys DOWN.

Click Source Link

Usage

From source file:com.gargoylesoftware.htmlunit.selenium.TypingTest.java

License:Apache License

/**
 * A test.//  w w w .java  2 s  .  c  om
 */
@Test
public void testArrowKeysAndPageUpAndDown() {
    final WebDriver driver = getWebDriver("/javascriptPage.html");

    final WebElement element = driver.findElement(By.id("keyReporter"));

    element.sendKeys(
            "a" + Keys.LEFT + "b" + Keys.RIGHT + Keys.UP + Keys.DOWN + Keys.PAGE_UP + Keys.PAGE_DOWN + "1");
    assertThat(element.getAttribute("value"), is("ba1"));
}

From source file:com.liferay.faces.test.alloy.issue.FACES_3274Tester.java

License:Open Source License

/**
 * This method only works in Firefox./* www.j  a  v  a  2  s .  c o m*/
 */
private static void runFACES_3274Test(BrowserDriver browserDriver, WaitingAsserter waitingAsserter,
        String inputXpath, boolean isAutocompleteOn) {

    String helloWorld = "Hello World!";
    Actions actions = browserDriver.createActions(inputXpath);
    WebElement inputElement = browserDriver.findElementByXpath(inputXpath);
    actions.sendKeys(inputElement, helloWorld, Keys.ENTER);
    browserDriver.performAndWaitForRerender(actions.build(), inputXpath);
    browserDriver.clearElement(inputXpath);

    String hello = "Hello";
    browserDriver.sendKeysToElement(inputXpath, hello);
    waitingAsserter.assertTextPresentInElementValue(hello, inputXpath);
    browserDriver.sendKeysToElement(inputXpath, Keys.DOWN, Keys.ENTER);
    waitingAsserter.assertTextPresentInElementValue(hello, inputXpath);

    ExpectedCondition<Boolean> textToBePresentInElementValue = ExpectedConditions
            .textToBePresentInElementValue(By.xpath(inputXpath), helloWorld);

    if (isAutocompleteOn) {
        waitingAsserter.assertTrue(textToBePresentInElementValue);
    } else {
        waitingAsserter.assertFalse(textToBePresentInElementValue);
    }
}

From source file:com.machinepublishers.jbrowserdriver.ElementServer.java

License:Apache License

/**
 * {@inheritDoc}/*from   ww w .  j  a  v a2s .  c om*/
 */
@Override
public void click() {
    AppThread.exec(contextItem.statusCode, new Sync<Object>() {
        @Override
        public Object perform() {
            validate(false);
            node.eval(SCROLL_INTO_VIEW);
            if (contextItem.context.get().keyboard.get().isShiftPressed()) {
                node.eval(new StringBuilder().append("this.origOnclick = this.onclick;")
                        .append("this.onclick=function(event){").append("  this.target='_blank';")
                        .append("  if(event){").append("    if(event.stopPropagation){")
                        .append("      event.stopPropagation();").append("    }").append("  }")
                        .append("  if(this.origOnclick){").append("    this.origOnclick(event? event: null);")
                        .append("  }").append("  this.onclick = this.origOnclick;").append("};").toString());
            }
            return null;
        }
    });

    if (node instanceof HTMLOptionElement) {
        AppThread.exec(contextItem.statusCode, new Sync<Object>() {
            @Override
            public Object perform() {
                validate(false);
                try {
                    new ElementServer((JSObject) ((HTMLOptionElement) node).getParentNode(), contextItem)
                            .click();
                } catch (RemoteException e) {
                    Util.handleException(e);
                }
                int index = ((HTMLOptionElement) node).getIndex();
                for (int i = 0; i <= index; i++) {
                    contextItem.context.get().robot.get().keysType(Keys.DOWN);
                }
                contextItem.context.get().robot.get().keysType(Keys.SPACE);
                return null;
            }
        });
    } else {
        AppThread.exec(contextItem.statusCode, new Sync<Object>() {
            @Override
            public Object perform() {
                validate(true);
                final JSObject obj = (JSObject) node.call("getBoundingClientRect");
                final double top = Double.parseDouble(obj.getMember("top").toString());
                final double left = Double.parseDouble(obj.getMember("left").toString());
                final double bottom = Double.parseDouble(obj.getMember("bottom").toString());
                final double right = Double.parseDouble(obj.getMember("right").toString());
                double clickX = (left + right) / 2d;
                double clickY = (top + bottom) / 2d;
                ElementServer doc = ElementServer.create(contextItem);
                if (!node.equals(doc.node.eval(
                        "(function(){return document.elementFromPoint(" + clickX + "," + clickY + ");})();"))) {
                    final Stage stage = contextItem.stage.get();
                    final int minX = Math.max(0, (int) Math.floor(left));
                    final int maxX = Math.min((int) Math.ceil(stage.getScene().getWidth()),
                            (int) Math.ceil(right));
                    final int minY = Math.max(0, (int) Math.floor(top));
                    final int maxY = Math.min((int) Math.ceil(stage.getScene().getHeight()),
                            (int) Math.ceil(bottom));
                    final int incX = (int) Math.max(1, .05d * (double) (maxX - minX));
                    final int incY = (int) Math.max(1, .05d * (double) (maxY - minY));
                    for (int x = minX; x <= maxX; x += incX) {
                        boolean found = false;
                        for (int y = minY; y <= maxY; y += incY) {
                            if (node.equals(doc.node.eval("(function(){return document.elementFromPoint(" + x
                                    + "," + y + ");})();"))) {
                                clickX = x;
                                clickY = y;
                                found = true;
                                break;
                            }
                        }
                        if (found) {
                            break;
                        }
                    }
                }
                final org.openqa.selenium.Point frameLocation = contextItem.selectedFrameLocation();
                contextItem.context.get().robot.get().mouseMove(clickX + frameLocation.getX(),
                        clickY + frameLocation.getY());
                contextItem.context.get().robot.get().mouseClick(MouseButton.LEFT);
                return null;
            }
        });
    }
}

From source file:com.pentaho.ctools.issues.cde.CDE430.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name: // www  .  j a  va 2s . co m
 *   Assert Popup Export Component properties show list with type options
 *
 * Description: 
 *   The test pretends validate the CDE-430 issue, so when user clicks the down arron when Chart Exprt or Data Export Types are
 *   selected, a drop down list is shown with valid type options
 *   
 * Steps:
 *  1. Open new CDE dashboard and go to Components Panel
 *  2. Add Export Popup Component and go to Advanced Properties
 *  3. Assert list is shown for Chart Export Type
 *  4. Assert list is shown for Data Export Type
 */
@Test
public void tc01_PopupExportComponent_TypeListShown() {
    this.log.info("tc01_PopupExportComponent_TypeListShown");

    /* 
     * ## Step 1 
     */
    //New CDE dashboard
    driver.get(PageUrl.CDE_DASHBOARD);
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));

    //Go to components Panel
    WebElement componentsButton = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@class='componentsPanelButton']"));
    assertNotNull(componentsButton);
    componentsButton.click();
    WebElement componentsPanel = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.id("panel-componentens_panel"));
    assertNotNull(componentsPanel);

    /* 
     * ## Step 2 
     */
    //Add Export Popup Component
    WebElement expandOthers = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath(
            "//div[@id='cdfdd-components-pallete']/div[@id='cdfdd-components-palletePallete']/div[2]/h3/a"));
    assertNotNull(expandOthers);
    expandOthers.click();
    WebElement exportPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']//a[@title='Export Popup Component']"));
    assertNotNull(exportPopup);
    exportPopup.click();

    //Click Advanced Properties
    WebElement advancedProperties = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath(
            "//div[@id='cdfdd-components-properties']/div/div/div[@class='advancedProperties propertiesUnSelected']"));
    assertNotNull(advancedProperties);
    advancedProperties.click();
    this.elemHelper.WaitForAttributeValueEqualsTo(driver,
            By.xpath("//div[@id='cdfdd-components-properties']/div/div/div[3]"), "class",
            "advancedProperties propertiesSelected");

    /* 
     * ## Step 3 
     */
    //Assert list appears for Chart Types to Export
    WebElement chartType = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//td[@title='Type for Chart Image to Export']/../td[2]"));
    assertNotNull(chartType);
    chartType.click();
    WebElement inputChart = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//td[@title='Type for Chart Image to Export']/../td[2]/form/input"));
    assertNotNull(inputChart);
    inputChart.clear();

    /* Robot robot1;
     try {
       robot1 = new Robot();
       robot1.keyPress( KeyEvent.VK_ENTER );
       robot1.keyRelease( KeyEvent.VK_ENTER );
       robot1.keyPress( KeyEvent.VK_ENTER );
       robot1.keyRelease( KeyEvent.VK_ENTER );
       robot1.keyPress( KeyEvent.VK_DOWN );
       robot1.keyRelease( KeyEvent.VK_DOWN );
     } catch ( AWTException e ) {
       e.printStackTrace();
     }*/
    Actions a = new Actions(driver);
    a.sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).build().perform();
    WebElement listOption1 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//body/ul/li/a"));
    assertNotNull(listOption1);
    String textOption1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li/a"));
    assertEquals("png", textOption1);
    WebElement listOption2 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//body/ul/li[2]/a"));
    assertNotNull(listOption2);
    String textOption2 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[2]/a"));
    assertEquals("svg", textOption2);
    a.sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).build().perform();
    this.elemHelper.WaitForElementNotPresent(driver, By.xpath("//body/ul/li/a"));

    /* 
     * ## Step 4 
     */
    //Assert list appears for Data Types to Export
    WebElement dataType = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//td[@title='Type for Data File to Export']/../td[2]"));
    assertNotNull(dataType);
    dataType.click();
    WebElement inputData = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//td[@title='Type for Data File to Export']/../td[2]/form/input"));
    assertNotNull(inputData);
    inputData.clear();

    /*try {
      robot1 = new Robot();
      robot1.keyPress( KeyEvent.VK_ENTER );
      robot1.keyRelease( KeyEvent.VK_ENTER );
      robot1.keyPress( KeyEvent.VK_ENTER );
      robot1.keyRelease( KeyEvent.VK_ENTER );
      robot1.keyPress( KeyEvent.VK_DOWN );
      robot1.keyRelease( KeyEvent.VK_DOWN );
    } catch ( AWTException e ) {
      e.printStackTrace();
    }*/
    a.sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).build().perform();
    listOption1 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li/a"));
    assertNotNull(listOption1);
    textOption1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li/a"));
    assertEquals("xls", textOption1);
    listOption2 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li[2]/a"));
    assertNotNull(listOption2);
    textOption2 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[2]/a"));
    assertEquals("csv", textOption2);
    WebElement listOption3 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//body/ul/li[3]/a"));
    assertNotNull(listOption3);
    String textOption3 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[3]/a"));
    assertEquals("xml", textOption3);
    WebElement listOption4 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//body/ul/li[4]/a"));
    assertNotNull(listOption4);
    String textOption4 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[4]/a"));
    assertEquals("json", textOption4);
}

From source file:com.pentaho.ctools.issues.cde.CDE505.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name:// ww  w  .  j a v a 2  s  . co m
 *    CHeck parameter list is presented in alphabetical order
 *
 * Description:
 *    The test pretends validate the CDE-505 issue, so when user clicks to add 
 *    parameters the list shown is presented in alphabetical order. Also we 
 *    want to validate the CDE-507 issue where a "hidden" option is added to
 *    Table's selectable ColumnTypes. For CDE-534 asserting that empty entry 
 *    is added when opening parameters and column types.
 *
 * Steps:
 *    1. Wait for new Dashboard to be created, go to components panel
 *    2. Add parameters and name them "a", "b", "test", "test.ing", "testing" and "..."
 *    3. Add a table and click to add parameters. Assert empty parameter is added (CDE534)
 *    4. Click to show list and assert parameters are shown in alphabetical order
 *    5. Click Column types and assert "hidden" option is shown in list. Assert empty Arg is added (CDE534)
 *    
 */

@Test
public void tc01_ParametersList_SortedAlphabetically() {
    this.log.info("tc01_ParametersList_SortedAlphabetically");

    /*
     * ## Step 1
     */
    //Go to New CDE Dashboard
    CDEditor cdeditor = new CDEditor(driver);
    cdeditor.GoToNewCDE();
    cdeditor.GoToComponentPanel();

    /*
     * ## Step 2
     */
    //Expand Generic
    WebElement genericExpander = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/span"));
    assertNotNull(genericExpander);
    genericExpander.click();

    //Add parameter "a"
    String value1 = "a";
    WebElement addParameter = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Simple parameter']"));
    assertNotNull(addParameter);
    this.elemHelper.ClickJS(driver, By.xpath("//a[@title='Simple parameter']"));
    WebElement addedParameter1 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]"));
    assertNotNull(addedParameter1);
    WebElement parameterName1 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.cssSelector("form.cdfddInput input"));
    assertNotNull(parameterName1);
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value1);
    String parameterValue1 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//td[contains(text(), 'Name')]/../td[2]"));
    assertEquals(parameterValue1, value1);
    parameterValue1 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]/td[2]"));
    assertEquals(parameterValue1, value1);

    //Add parameter "z"
    String value2 = "z";
    addParameter = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Simple parameter']"));
    assertNotNull(addParameter);
    this.elemHelper.ClickJS(driver, By.xpath("//a[@title='Simple parameter']"));
    WebElement addedParameter2 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[3]"));
    assertNotNull(addedParameter2);
    WebElement parameterName2 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.cssSelector("form.cdfddInput input"));
    assertNotNull(parameterName2);
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value2);
    String parameterValue2 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//td[contains(text(), 'Name')]/../td[2]"));
    assertEquals(parameterValue2, value2);
    parameterValue2 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[3]/td[2]"));
    assertEquals(parameterValue2, value2);

    //Add parameter "test"
    String value3 = "test";
    addParameter = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Simple parameter']"));
    assertNotNull(addParameter);
    this.elemHelper.ClickJS(driver, By.xpath("//a[@title='Simple parameter']"));
    WebElement addedParameter3 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[4]"));
    assertNotNull(addedParameter3);
    WebElement parameterName3 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.cssSelector("form.cdfddInput input"));
    assertNotNull(parameterName3);
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value3);
    String parameterValue3 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//td[contains(text(), 'Name')]/../td[2]"));
    assertEquals(parameterValue3, value3);
    parameterValue3 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[4]/td[2]"));
    assertEquals(parameterValue3, value3);

    //Add parameter "test.ing"
    String value4 = "test.ing";
    String value5 = "testing";
    addParameter = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Simple parameter']"));
    assertNotNull(addParameter);
    this.elemHelper.ClickJS(driver, By.xpath("//a[@title='Simple parameter']"));
    WebElement addedParameter4 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"));
    assertNotNull(addedParameter4);
    WebElement parameterName4 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.cssSelector("form.cdfddInput input"));
    assertNotNull(parameterName4);
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value4);
    assertTrue(cdeditor.PopupPresent());
    Popup dialogPopup = cdeditor.Popup();
    assertNotNull(dialogPopup);
    assertEquals(dialogPopup.getTitle(), "Invalid Input");
    assertEquals(dialogPopup.getMessage(), "Argument " + value4
            + " invalid. Can only contain alphanumeric characters and the special _ character");
    assertTrue(cdeditor.PopupNotPresent());
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value5);
    String parameterValue5 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//td[contains(text(), 'Name')]/../td[2]"));
    assertEquals(parameterValue5, value5);
    parameterValue5 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]/td[2]"));
    assertEquals(parameterValue5, value5);

    //Add parameter "..."
    String value6 = "...";
    String value7 = "1test_ing";
    addParameter = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Simple parameter']"));
    assertNotNull(addParameter);
    addParameter.click();
    WebElement addedParameter6 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[6]"));
    assertNotNull(addedParameter6);
    WebElement parameterName6 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.cssSelector("form.cdfddInput input"));
    assertNotNull(parameterName6);
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value6);
    assertTrue(cdeditor.PopupPresent());
    Popup dialogPopup2 = cdeditor.Popup();
    assertNotNull(dialogPopup2);
    assertEquals(dialogPopup2.getTitle(), "Invalid Input");
    assertEquals(dialogPopup2.getMessage(), "Argument " + value6
            + " invalid. Can only contain alphanumeric characters and the special _ character");
    assertTrue(cdeditor.PopupNotPresent());
    this.elemHelper.SendKeysAndSubmit(driver, By.cssSelector("form.cdfddInput input"), value7);
    String parameterValue7 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//td[contains(text(), 'Name')]/../td[2]"));
    assertEquals(parameterValue7, value7);
    parameterValue7 = this.elemHelper.WaitForTextDifferentEmpty(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[6]/td[2]"));
    assertEquals(parameterValue7, value7);

    /*
     * ## Step 3
     */
    //Expand Charts
    WebElement othersExpander = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/span"));
    assertNotNull(othersExpander);
    othersExpander.click();

    //Add Table Component
    WebElement addTable = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='table Component']"));
    assertNotNull(addTable);
    addTable.click();
    WebElement addedTable = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[7]"));
    assertNotNull(addedTable);

    //Open Parameter assigning dialog
    WebElement paramProperty = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath(
            "//table[@id='table-cdfdd-components-properties']/tbody//td[@title=' Parameters to pass to the component']/../td[2]"));
    assertNotNull(paramProperty);
    paramProperty.click();
    WebElement paramPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("popup"));
    assertNotNull(paramPopup);

    /*
     * ## Step 4
     */
    //Click button to open parameter list
    WebElement paramPopupButton = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("val_0"));
    assertNotNull(paramPopupButton);
    paramPopupButton.click();

    //Press down to list all parameters added previews
    Actions a = new Actions(driver);
    a.sendKeys(Keys.DOWN).build().perform();
    WebElement paramList = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("ui-id-1"));
    assertNotNull(paramList);

    //Assert list of parameters is alphabetically ordered
    String param1 = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='popup_state_state0']//ul/li[1]/a"));
    String param2 = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='popup_state_state0']//ul/li[2]/a"));
    String param3 = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='popup_state_state0']//ul/li[3]/a"));
    String param4 = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='popup_state_state0']//ul/li[4]/a"));
    String param5 = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='popup_state_state0']//ul/li[5]/a"));
    assertEquals(param1, value7);
    assertEquals(param2, value1);
    assertEquals(param3, value3);
    assertEquals(param4, value5);
    assertEquals(param5, value2);

    WebElement cancelButton = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.id("popup_state0_buttonCancel"));
    assertNotNull(cancelButton);
    cancelButton.click();
    this.elemHelper.WaitForElementNotPresent(driver, By.id("popupstates"));

    /*
     * ## Step 5
     */
    WebElement columnTypes = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath(
            "//table[@id='table-cdfdd-components-properties']/tbody//td[@title='The table column types. Example: [numeric, string, circle, link, sparkline]']/../td[2]"));
    assertNotNull(columnTypes);
    columnTypes.click();
    WebElement columnPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("popup"));
    assertNotNull(columnPopup);
    WebElement columnType = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("arg_0"));
    assertNotNull(columnType);
    columnType.click();

    a.sendKeys(Keys.DOWN).build().perform();
    WebElement columnList = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='popup_state_state0']//ul"));
    assertNotNull(columnList);
    WebElement hiddenOption = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='popup_state_state0']//ul//a[contains(text(),'hidden')]"));
    assertNotNull(hiddenOption);
}

From source file:com.pentaho.ctools.issues.cde.editor.CDEComponentPanel.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name:/*from w  w  w .  j  a  v  a 2 s.  co  m*/
 *    This test validates all issues related to CDE's Component Panel
 *
 * Description:
 *    399: Accordion works as expected
 *    410: Shortcuts work
 *    529: Opening a popup blocks the use of the shortcuts to navigate
 *    CDF-504: baseAxisFont is exposed in Advanced Properties of CCC chart components
 *    
 * Steps:
 *    1. Open CDE sample in edit mode, go to components panel and add some components
 *    2. Assert down, up, left and right shortcuts work on components panel
 *    3. Assert tab and enter shortcuts work on components panel
 *    4. Assert opening parameter popup blocks navigation by arrows
 *    5. Go to chart Advanced Properties and assert baseAxisFont is there
 */
@Test
public void tc01_CDEDashboardEdit_ComponentPanel() {
    this.log.info("tc01_CDEDashboardEdit_ComponentPanel");

    /*
     * ## Step 1
     */
    //Open CDE sample in edit mode
    this.elemHelper.Get(driver, PageUrl.CDE_DASHBOARD);
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));

    //Go to Components Panel
    this.elemHelper.Click(driver, By.xpath("//div[@title='Components Panel']/a"));

    //Assert behavior of accordion
    WebElement otherExpander = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/a"));
    assertNotNull(otherExpander);
    String otherText = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/a"));
    assertEquals("Others", otherText);
    this.elemHelper.Click(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/a"));
    WebElement tableComponent = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='table Component']"));
    assertNotNull(tableComponent);
    WebElement genericExpander = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/a"));
    assertNotNull(genericExpander);
    String genericText = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/a"));
    assertEquals("Generic", genericText);
    this.elemHelper.Click(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/a"));
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath("//a[@title='table Component']"));

    //Add some Components
    WebElement chartExpander = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div/h3/span"));
    assertNotNull(chartExpander);
    chartExpander.click();
    WebElement addAreaChart = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div//a[@title='CCC Area Chart']"));
    assertNotNull(addAreaChart);
    addAreaChart.click();
    WebElement addBulletChart = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div//a[@title='CCC Bullet Chart']"));
    assertNotNull(addBulletChart);
    addBulletChart.click();
    otherExpander = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/span"));
    assertNotNull(otherExpander);
    otherExpander.click();
    WebElement addTable = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]//a[@title='table Component']"));
    assertNotNull(addTable);
    addTable.click();
    WebElement addButton = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]//a[@title='Button Component']"));
    assertNotNull(addButton);
    addButton.click();

    /*
     * ## Step 2
     */
    //Select first chart group
    this.elemHelper.Click(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr/td"));
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr"), "class",
            "expanded initialized parent ui-state-active");
    String chartGroup = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr"))
            .getAttribute("class");
    assertEquals(chartGroup, "expanded initialized parent ui-state-active");

    //Assert groups are expanded and clicking left will collapse them, also assert down arrow moves between showing elements
    WebElement areaChart = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]"));
    assertNotNull(areaChart);
    tableComponent = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"));
    assertNotNull(tableComponent);
    Actions a = new Actions(driver);
    a.sendKeys(Keys.LEFT).sendKeys(Keys.DOWN).sendKeys(Keys.LEFT).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[4]"), "class",
            "initialized parent ui-state-active collapsed");
    String otherGroup = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[4]"))
            .getAttribute("class");
    assertEquals(otherGroup, "initialized parent ui-state-active collapsed");
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]"));
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"));

    //Assert clicking right arrow expands groups    
    a.sendKeys(Keys.RIGHT).sendKeys(Keys.UP).sendKeys(Keys.RIGHT).build().perform();
    areaChart = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]"));
    assertNotNull(areaChart);
    tableComponent = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"));
    assertNotNull(tableComponent);

    //Go to to table component and assert it's selected
    a.sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"), "class",
            "child-of-OTHERCOMPONENTS initialized collapsed ui-state-active");
    String tableClass = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"))
            .getAttribute("class");
    assertEquals(tableClass, "child-of-OTHERCOMPONENTS initialized collapsed ui-state-active");

    /*
     * ## Step 3
     */
    //Click tab key and assert focus has changed to properties table
    a.sendKeys(Keys.TAB).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-components-properties']/tbody/tr"), "class",
            "initialized ui-state-active");
    String nameProperty = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-properties']/tbody/tr"))
            .getAttribute("class");
    assertEquals(nameProperty, "initialized ui-state-active");

    //Click enter to change following properties "Name" and "Parameters"
    a.sendKeys(Keys.ENTER).sendKeys("a").sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN)
            .sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).build().perform();

    /*
     * ## Step 4
     */
    //Change "Parameter" and assert using down arrow to navigate is blocked
    //Focus to the top
    this.elemHelper.MoveToElement(driver, By.cssSelector(
            "#cdfdd-components-properties > div > div.tableCaption.ui-state-default > div.simpleProperties.propertiesSelected"));
    this.elemHelper.WaitForAttributeValue(driver, By.xpath("//td[contains(text(),'Parameter')]/.."), "class",
            "initialized ui-state-active");
    String parameterProperty = this.elemHelper
            .FindElement(driver, By.xpath("//td[contains(text(),'Parameter')]/..")).getAttribute("class");
    assertEquals(parameterProperty, "initialized ui-state-active");
    a.sendKeys(Keys.ENTER).build().perform();
    WebElement popupParameter = this.elemHelper.FindElement(driver, By.id("popupstates"));
    assertNotNull(popupParameter);
    String popupTitle = this.elemHelper.WaitForTextDifferentEmpty(driver, By
            .cssSelector("#popup_state_state0 > div > div.popup-header-container > div.popup-title-container"));
    assertEquals(popupTitle, "Parameters");
    a.sendKeys(Keys.DOWN).build().perform();
    this.elemHelper.ClickJS(driver, By.id("popup_state0_buttonCancel"));
    assertTrue(this.elemHelper.WaitForElementNotPresent(driver, By.id("popupstates")));
    this.elemHelper.WaitForAttributeValue(driver, By.xpath("//td[contains(text(),'Parameter')]/.."), "class",
            "initialized ui-state-active");
    parameterProperty = this.elemHelper.FindElement(driver, By.xpath("//td[contains(text(),'Parameter')]/.."))
            .getAttribute("class");
    assertEquals(parameterProperty, "initialized ui-state-active");

    //assert values are changed
    String nameValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//td[contains(text(),'Name')]/../td[2]"));
    assertEquals(nameValue, "a");

    /*
     * ## Step 5
     */
    areaChart = this.elemHelper.FindElement(driver, By
            .xpath("//table[@id='table-cdfdd-components-components']//td[contains(text(),'CCC Area Chart')]"));
    assertNotNull(areaChart);
    areaChart.click();
    WebElement advancedProperties = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='cdfdd-components-properties']//div[@class='advancedProperties propertiesUnSelected']"));
    assertNotNull(advancedProperties);
    advancedProperties.click();
    WebElement baseAxisFont = this.elemHelper.FindElement(driver, By.xpath(
            "//table[@id='table-cdfdd-components-properties']//td[@title='The font used by the panel.']"));
    assertNotNull(baseAxisFont);

}

From source file:com.pentaho.ctools.issues.cde.editor.CDEDataPanel.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name://from www.  ja v a2s.  c  o  m
 *    This test is meant to validate all issues related to CDE's Data Panel
 *
 * Description:
 *    CDE-410: Shortcuts work
 *
 * Steps:
 *    1. Open CDE sample in edit mode, go to data panel and add some datasources
 *    2. Assert down, up, left and right shortcuts work on components panel
 *    3. Assert tab and enter shortcuts work on data panel
 *        
 **/
@Test
public void tc01_CDEDashboardEdit_DataPanel() {
    this.log.info("tc01_CDEDashboardEdit_DataPanel");

    /*
     * ## Step 1
     */
    //Open CDE sample in edit mode
    driver.get(PageUrl.CDE_DASHBOARD);
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));

    //Go to Components Panel
    this.elemHelper.Click(driver, By.xpath("//div[@title='Datasources Panel']/a"));

    //Add some Datasources
    WebElement mdxExpander = this.elemHelper.FindElement(driver, By
            .xpath("//div[@id='cdfdd-datasources-palletePallete']//a[contains(text(),'MDX Queries')]/../span"));
    assertNotNull(mdxExpander);
    mdxExpander.click();
    WebElement addDenormalMdx = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='cdfdd-datasources-palletePallete']//a[@title='denormalizedMdx over mondrianJdbc']"));
    assertNotNull(addDenormalMdx);
    addDenormalMdx.click();
    WebElement addMDX = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-datasources-palletePallete']//a[@title='mdx over mondrianJndi']"));
    assertNotNull(addMDX);
    addMDX.click();
    WebElement sqlExpander = this.elemHelper.FindElement(driver, By
            .xpath("//div[@id='cdfdd-datasources-palletePallete']//a[contains(text(),'SQL Queries')]/../span"));
    assertNotNull(sqlExpander);
    sqlExpander.click();
    WebElement addSqlJdbc = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-datasources-palletePallete']//a[@title='sql over sqlJdbc']"));
    assertNotNull(addSqlJdbc);
    addSqlJdbc.click();
    WebElement addSqlJndi = this.elemHelper.FindElement(driver,
            By.xpath("//div[@id='cdfdd-datasources-palletePallete']//a[@title='sql over sqlJndi']"));
    assertNotNull(addSqlJndi);
    addSqlJndi.click();

    /*
     * ## Step 2
     */
    //Select first chart group
    this.elemHelper.Click(driver, By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr/td"));
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr"), "class",
            "expanded initialized parent ui-state-active");
    String mdxGroup = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr"))
            .getAttribute("class");
    assertEquals(mdxGroup, "expanded initialized parent ui-state-active");

    //Assert groups are expanded and clicking left will collapse them, also assert down arrow moves between showing elements
    WebElement mdxDenormal = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[2]"));
    assertNotNull(mdxDenormal);
    WebElement sqlJdbc = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[5]"));
    assertNotNull(sqlJdbc);
    Actions a = new Actions(driver);
    a.sendKeys(Keys.LEFT).sendKeys(Keys.DOWN).sendKeys(Keys.LEFT).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[4]"), "class",
            "initialized parent ui-state-active collapsed");
    String otherGroup = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[4]"))
            .getAttribute("class");
    assertEquals(otherGroup, "initialized parent ui-state-active collapsed");
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[2]"));
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[5]"));
    assertTrue(this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[2]")));
    assertTrue(this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[5]")));

    //Assert clicking right arrow expands groups    
    a.sendKeys(Keys.RIGHT).sendKeys(Keys.UP).sendKeys(Keys.RIGHT).build().perform();
    mdxDenormal = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[2]"));
    assertNotNull(mdxDenormal);
    sqlJdbc = this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[5]"));
    assertNotNull(sqlJdbc);

    //Go to to sqlJndi and assert it's selected
    a.sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN)
            .build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[6]"), "class",
            "child-of-SQL initialized collapsed ui-state-active");
    String areaChartClass = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-datasources-datasources']/tbody/tr[6]"))
            .getAttribute("class");
    assertEquals(areaChartClass, "child-of-SQL initialized collapsed ui-state-active");

    /*
     * ## Step 3
     */
    //Click tab key and assert focus has changed to properties table
    a.sendKeys(Keys.TAB).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr"), "class",
            "initialized ui-state-active");
    String nameProperty = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr"))
            .getAttribute("class");
    assertEquals(nameProperty, "initialized ui-state-active");

    //Click enter to change following properties "Name"
    a.sendKeys(Keys.ENTER).sendKeys("a").sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN)
            .sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).build().perform();

    /*
     * ## Step 4
     */
    //Change "Parameter" and assert using down arrow to navigate is blocked
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr[5]"), "class",
            "initialized ui-state-active");
    String parameterProperty = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr[5]"))
            .getAttribute("class");
    assertEquals(parameterProperty, "initialized ui-state-active");
    a.sendKeys(Keys.ENTER).build().perform();
    assertNotNull(this.elemHelper.FindElement(driver, By.id("popup")));
    assertNotNull(this.elemHelper.FindElement(driver, By.id("arg_0")));
    assertNotNull(this.elemHelper.FindElement(driver, By.id("val_0")));
    a.sendKeys(Keys.TAB).sendKeys(Keys.TAB).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.UP).build()
            .perform();

    WebElement elemIntegerHighlight = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.cssSelector(
            "ul#select2-results-1.select2-results li.select2-results-dept-0.select2-result.select2-result-selectable.select2-highlighted"));
    assertNotNull(elemIntegerHighlight);

    WebElement closePopup = this.elemHelper.FindElement(driver, By.id("popup_state0_buttonCancel"));
    assertNotNull(closePopup);
    closePopup.click();
    assertTrue(this.elemHelper.WaitForElementNotPresent(driver, By.id("popup"), 3));

    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr[5]"), "class",
            "initialized ui-state-active");
    parameterProperty = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr[5]"))
            .getAttribute("class");
    assertEquals(parameterProperty, "initialized ui-state-active");

    //assert values are changed
    String nameValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//table[@id='table-cdfdd-datasources-properties']/tbody/tr/td[2]"));
    assertEquals(nameValue, "a");
}

From source file:com.pentaho.ctools.issues.cde.editor.CDELayoutPanel.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name://from w  w w.  ja v a2 s . c  o m
 *    This test is meant to validate all issues related to CDE's Layout Panel
 *
 * Description:
 *    CDE-270: Layout elements are draggable
 *    CDE-366: Style and Dashboard type changes are kept when saving dashboard
 *    CDE-395: Bootstrap is default renderer
 *    CDE-402: When applying template, user is asked for confirmation before it is applied
 *    CDE-406: Drag and Drop of Freeform elements works
 *    CDE-407: Able to duplicate spacers
 *    CDE-410: Shortcuts work
 *    CDE-425: Shortcuts work
 *    CDE-432: Left is the first option of text alignment
 *    CDE-527: Only Column can be direct child of Rows in a bootstrap dashboard
 *    CDE-528: If a bootstrap Column has no Xs defined a default of 12 is used
 *
 * Steps:
 *    1. Open new CDE dashboard and assert bootstrap is selected as renderer
 *    2. Use shortcuts to add and delete elements
 *    3. Add some elements and Drag them to other positions, asserting new positions
 *    4. Set template and assert it is correctly applied
 *    5. Assert navigation shortcuts work as expected and set clear Xs of an element
 *    6. Edit Settings and save dashboard. Preview dashboard and assert Xs is 12 by default
 */
@Test
public void tc01_CDEDashboardEdit_LayoutPanel() {
    this.log.info("tc01_CDEDashboardEdit_LayoutPanel");

    /*
     * ## Step 1
     */
    //Go to New CDE Dashboard
    driver.get(PageUrl.CDE_DASHBOARD);
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));

    //Open Dashboard Settings and assert bootstrap is selected as renderer
    WebElement settingsLink = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='headerLinks']//a[@onclick='cdfdd.saveSettings()']"));
    assertNotNull(settingsLink);
    settingsLink.click();
    WebElement settingsPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='popup']//div[@id='popupstates']"));
    assertNotNull(settingsPopup);
    Select dashboardType = new Select(
            this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("rendererInput")));
    String selectedOption = dashboardType.getFirstSelectedOption().getAttribute("value");
    assertEquals("bootstrap", selectedOption);
    WebElement cancelButton = this.elemHelper.FindElement(driver, By.id("popup_state0_buttonCancel"));
    assertNotNull(cancelButton);
    cancelButton.click();
    this.elemHelper.WaitForElementNotPresent(driver, By.xpath("//div[@id='popup']//div[@id='popupstates']"));

    /*
     * ## Step 2
     */
    //Add Row and verify that columns and html can not be added outside of rows
    this.elemHelper.Click(driver, By.id("table-cdfdd-layout-tree"));
    Actions a = new Actions(driver);
    a.sendKeys("c").sendKeys("h").sendKeys("r").build().perform();
    this.elemHelper.Click(driver, By.id("table-cdfdd-layout-tree"));

    //Add Column
    a.sendKeys("c").build().perform();

    //Add Html
    this.elemHelper.Click(driver, By.id("table-cdfdd-layout-tree"));
    a.sendKeys("h").build().perform();

    //Assert elements were successfully created
    WebElement row = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"));
    assertNotNull(row);
    this.elemHelper.WaitForTextPresence(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"),
            "Row");
    String rowText = row.getText();
    assertEquals(rowText, "Row");
    WebElement column = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[2]/td"));
    assertNotNull(column);
    this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[2]/td"), "Column");
    String columnText = column.getText();
    assertEquals(columnText, "Column");
    WebElement html = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[3]/td"));
    assertNotNull(html);
    this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[3]/td"), "Html");
    String htmlText = html.getText();
    assertEquals(htmlText, "Html");

    //Add spacer and duplicate it
    column.click();
    WebElement spacerButton = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Add Space']"));
    assertNotNull(spacerButton);
    spacerButton.click();
    WebElement spacer = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td"));
    assertNotNull(spacer);
    this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td"), "Space");
    String spacerText = spacer.getText();
    assertEquals(spacerText, "Space");
    column.click();
    spacer.click();
    a.keyDown(Keys.SHIFT).sendKeys("d").keyUp(Keys.SHIFT).build().perform();
    spacer = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td"));
    assertNotNull(spacer);
    WebElement spacer2 = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[5]/td"));
    assertNotNull(spacer2);
    this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td"), "Space");
    spacerText = spacer.getText();
    assertEquals(spacerText, "Space");
    this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[5]/td"), "Space");
    String spacerText2 = spacer2.getText();
    assertEquals(spacerText2, "Space");

    //Delete elements and assert they are no longer present
    this.elemHelper.Click(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"));
    a.keyDown(Keys.SHIFT).sendKeys("x").keyUp(Keys.SHIFT).build().perform();
    assertTrue(this.elemHelper.WaitForElementNotPresent(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td")));

    /*
     * ## Step 3
     */
    //Add elements
    WebElement addRow = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Add Row']"));
    assertNotNull(addRow);
    addRow.click();
    WebElement addColumn = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Add Columns']"));
    WebElement addFreeForm = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Add FreeForm']"));
    WebElement addBootstrap = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Add Bootstrap Panel']"));
    assertNotNull(addFreeForm);
    assertNotNull(addColumn);
    assertNotNull(addBootstrap);
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add Bootstrap Panel']"))
            .click();
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add Row']")).click();
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add FreeForm']")).click();
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add Row']")).click();
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add Columns']")).click();
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add Columns']")).click();
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='Add FreeForm']")).click();

    //Assert elements on Layout
    String row1 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"), "Row");
    assertEquals("Row", row1);
    String bootstrap = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[2]/td"), "Bootstrap Panel");
    assertEquals("Bootstrap Panel", bootstrap);
    String row2 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[6]/td"), "Row");
    assertEquals("Row", row2);
    String freeform1 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[7]/td"), "FreeForm");
    assertEquals("FreeForm", freeform1);
    String row3 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[8]/td"), "Row");
    assertEquals("Row", row3);
    String column1 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[9]/td"), "Column");
    assertEquals("Column", column1);
    String column2 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[10]/td"), "Column");
    assertEquals("Column", column2);
    String freeform2 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[11]/td"), "FreeForm");
    assertEquals("FreeForm", freeform2);

    //Assert bootstrap and freeform are parent elements
    String bootstrapClass = this.elemHelper.GetAttribute(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[2]"), "class");
    assertTrue(bootstrapClass.contains("parent"));
    String freeformClass = this.elemHelper.GetAttribute(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[7]"), "class");
    assertTrue(freeformClass.contains("parent"));

    //Move elements
    this.elemHelper.DragAndDrop(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[11]/td"),
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[1]/td"));
    this.elemHelper.DragAndDrop(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[8]/td"),
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[2]/td"));

    //Assert new positions
    freeform1 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"), "FreeForm");
    assertEquals("FreeForm", freeform1);
    freeform2 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[2]/td"), "FreeForm");
    assertEquals("FreeForm", freeform2);
    row1 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[3]/td"), "Row");
    assertEquals("Row", row1);
    column1 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td"), "Column");
    assertEquals("Column", column1);
    column2 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[5]/td"), "Column");
    assertEquals("Column", column2);
    row2 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[6]/td"), "Row");
    assertEquals("Row", row2);
    bootstrap = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[7]/td"), "Bootstrap Panel");
    assertEquals("Bootstrap Panel", bootstrap);
    row3 = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[11]/td"), "Row");
    assertEquals("Row", row3);

    /*
     * ## Step 4
     */
    //Apply template

    WebElement templateButton = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//a[@title='Apply Template']"));
    assertNotNull(templateButton);
    templateButton.click();
    this.elemHelper.WaitForFrameReady(driver, By.id("popup"));
    WebElement templatePopup = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("popup"));
    assertNotNull(templatePopup);
    String templateText = this.elemHelper
            .FindElement(driver, By.xpath("//div[@class='template-scroll']/div[2]/span")).getText();
    assertEquals("2 Columns Template", templateText);
    this.elemHelper.Click(driver, By.xpath("//div[@class='template-scroll']/div[2]/div/img"));
    WebElement templateOk = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.id("popup_state0_buttonOk"));
    assertNotNull(templateOk);
    this.elemHelper.Click(driver, By.id("popup_state0_buttonOk"));
    assertTrue(this.elemHelper.WaitForElementNotPresent(driver, By.id("popup")));
    WebElement confirmationPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("popup"));
    assertNotNull(confirmationPopup);
    String warningText = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='popup-body-container layout-popup']"));
    assertEquals("Are you sure you want to load the template?WARNING: Dashboard Layout will be overwritten!",
            warningText);
    WebElement confirmationOk = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.id("popup_state0_buttonOk"));
    assertNotNull(confirmationOk);
    this.elemHelper.Click(driver, By.id("popup_state0_buttonOk"));
    this.elemHelper.WaitForElementNotPresent(driver, By.id("popup"));

    //Asset elements were created
    String trtdText = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"), "Row");
    String trtd2Text = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td[2]"), "Header");
    String tr4tdText = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td"), "Row");
    String tr4td2Text = this.elemHelper.WaitForTextPresence(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]/td[2]"), "Spacer");
    assertEquals("Row", trtdText);
    assertEquals("Header", trtd2Text);
    assertEquals("Row", tr4tdText);
    assertEquals("Spacer", tr4td2Text);

    /*
     * ## Step 5
     */
    //Press down and assert second Row is selected
    this.elemHelper.Click(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr/td"));
    String firstRowClass = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr"))
            .getAttribute("class");
    assertEquals(firstRowClass, "ui-draggable ui-droppable initialized parent collapsed ui-state-active");
    a.sendKeys(Keys.DOWN).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]"), "class",
            "ui-draggable ui-droppable initialized ui-state-active");
    String secondRowClass = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[4]")).getAttribute("class");
    assertEquals(secondRowClass, "ui-draggable ui-droppable initialized ui-state-active");

    //Assert columns aren't visible, go to row and expand it and then assert columns are visible
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[6]"));
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[7]"));

    a.sendKeys(Keys.DOWN).sendKeys(Keys.RIGHT).build().perform();
    WebElement firstColumn = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[6]"));
    assertNotNull(firstColumn);
    WebElement secondColumn = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[7]"));
    assertNotNull(secondColumn);

    //Go to second column and back to first and assert first column is selected
    a.sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys("c").sendKeys(Keys.TAB).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[8]"), "class", "ui-state-active");
    String firstColumnClass = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[8]"))
            .getAttribute("class");
    assertTrue(firstColumnClass.contains("ui-state-active"));

    //Click tab key and assert focus has changed to properties table
    a.sendKeys(Keys.TAB).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr"), "class",
            "initialized ui-state-active");
    String firstPropertyClass = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr"))
            .getAttribute("class");
    assertEquals(firstPropertyClass, "initialized ui-state-active");

    //Click enter to change following properties "Name", "Span size" and "Right border"
    a.sendKeys(Keys.ENTER).sendKeys("a").sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).build().perform();

    //assert name has changed
    String columnName = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr/td[2]"));
    assertEquals(columnName, "a");

    //Change "Extra Small Devices" and "Text Align"
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[2]"), "class",
            "initialized ui-state-active");
    String xsInput = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[2]"))
            .getAttribute("class");
    assertEquals(xsInput, "initialized ui-state-active");
    a.sendKeys(Keys.ENTER).build().perform();
    this.elemHelper
            .FindElement(driver,
                    By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[2]/td[2]/form/input"))
            .clear();
    a.sendKeys(Keys.ENTER).build().perform();

    //assert values are changed
    String xsValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[2]/td[2]"));
    assertEquals(xsValue, "-");

    a.sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN)
            .sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.ENTER)
            .sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).build()
            .perform();
    String alignValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[10]/td[2]"));
    assertEquals(alignValue, "Left");
    //Click tab and assert focus has gone back to first table
    a.sendKeys(Keys.TAB).build().perform();
    this.elemHelper.WaitForAttributeValue(driver,
            By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[8]"), "class", "initialized");
    String columnClass = this.elemHelper
            .FindElement(driver, By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[8]"))
            .getAttribute("class");
    assertEquals(columnClass, "initialized");

    //Collapse Row and assert columns aren't showing
    a.sendKeys(Keys.UP).sendKeys(Keys.UP).sendKeys(Keys.UP).sendKeys(Keys.LEFT).build().perform();
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[6]"));
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[7]"));
    this.elemHelper.WaitForElementInvisibility(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[8]"));

    /*
     * ## Step 6
     */
    //Save Dashboard
    WebElement saveDashboard = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='headerLinks']//a[@id='Save']"));
    assertNotNull(saveDashboard);
    saveDashboard.click();
    WebElement folderSelector = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='saveAsFEContainer']//a[@rel='public/']"));
    assertNotNull(folderSelector);
    folderSelector.click();
    WebElement inputName = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("fileInput"));
    assertNotNull(inputName);
    inputName.sendKeys("CDE366");
    WebElement okButton = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@class='popupbuttons']/button[@id='popup_state0_buttonOk']"));
    okButton.click();
    this.elemHelper.WaitForElementNotPresent(driver, By.xpath("//div[@class='popupbuttons']"));
    WebElement title = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@title='CDE366']"));
    assertNotNull(title);
    this.failure = 0;

    //Open Dashboard Settings
    settingsLink = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='headerLinks']//a[@onclick='cdfdd.saveSettings()']"));
    assertNotNull(settingsLink);
    settingsLink.click();
    settingsPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='popup']//div[@id='popupstates']"));
    assertNotNull(settingsPopup);

    //Edit Style and Dashboard Type
    Select style = new Select(this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("styleInput")));
    style.selectByVisibleText("WDDocs");
    Select dashType = new Select(
            this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("rendererInput")));
    dashType.selectByVisibleText("blueprint");

    //Click save and assert user gets a message of "Saved Successfully"
    okButton = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("popup_state0_buttonOk"));
    assertNotNull(okButton);
    okButton.click();
    WebElement notifySuccess = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='notifyBar']"));
    assertNotNull(notifySuccess);
    String successMessage = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@id='notifyBar']/div[@class='notify-bar-message']"));
    assertEquals("Dashboard Settings saved successfully", successMessage);

    //Open dashboard in preview mode
    this.elemHelper.Get(driver, PageUrl.ISSUES_CDE_366);
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));

    //Assert Xs is set to 12 as default
    WebElement xsColumn = this.elemHelper.FindElement(driver, By.xpath("//div[@id='Body']/div[3]"));
    assertNotNull(xsColumn);
    String xsNumber = xsColumn.getAttribute("class");
    assertEquals("col-xs-12 last", xsNumber);

    //Open dashboard in edit
    this.elemHelper.Get(driver, PageUrl.ISSUES_CDE_366_EDIT);

    //Open Settings and assert Style and Dashboard Type were saved 
    settingsLink = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='headerLinks']//a[@onclick='cdfdd.saveSettings()']"));
    assertNotNull(settingsLink);
    settingsLink.click();
    settingsPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//div[@id='popup']//div[@id='popupstates']"));
    assertNotNull(settingsPopup);
    WebElement selectedStyle = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//select[@id='styleInput']/option[@selected='']"));
    String selectedValue = selectedStyle.getAttribute("value");
    assertEquals("WDDocs", selectedValue);
    WebElement selectedDash = this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//select[@id='rendererInput']/option[@selected='']"));
    selectedValue = selectedDash.getAttribute("value");
    assertEquals("blueprint", selectedValue);

    /*
     * ## Step 7
     */
    BrowseFiles browse = new BrowseFiles(driver);
    browse.DeleteMultipleFilesByName("/public", "CDE366");
    browse.EmptyTrash();
    this.failure = 1;
}

From source file:com.thoughtworks.selenium.webdriven.commands.SendKeys.java

License:Apache License

@Override
protected Void handleSeleneseCommand(WebDriver driver, String locator, String value) {
    alertOverride.replaceAlertMethod(driver);

    value = value.replace("${KEY_ALT}", Keys.ALT);
    value = value.replace("${KEY_CONTROL}", Keys.CONTROL);
    value = value.replace("${KEY_CTRL}", Keys.CONTROL);
    value = value.replace("${KEY_META}", Keys.META);
    value = value.replace("${KEY_COMMAND}", Keys.COMMAND);
    value = value.replace("${KEY_SHIFT}", Keys.SHIFT);

    value = value.replace("${KEY_BACKSPACE}", Keys.BACK_SPACE);
    value = value.replace("${KEY_BKSP}", Keys.BACK_SPACE);
    value = value.replace("${KEY_DELETE}", Keys.DELETE);
    value = value.replace("${KEY_DEL}", Keys.DELETE);
    value = value.replace("${KEY_ENTER}", Keys.ENTER);
    value = value.replace("${KEY_EQUALS}", Keys.EQUALS);
    value = value.replace("${KEY_ESCAPE}", Keys.ESCAPE);
    value = value.replace("${KEY_ESC}", Keys.ESCAPE);
    value = value.replace("${KEY_INSERT}", Keys.INSERT);
    value = value.replace("${KEY_INS}", Keys.INSERT);
    value = value.replace("${KEY_PAUSE}", Keys.PAUSE);
    value = value.replace("${KEY_SEMICOLON}", Keys.SEMICOLON);
    value = value.replace("${KEY_SPACE}", Keys.SPACE);
    value = value.replace("${KEY_TAB}", Keys.TAB);

    value = value.replace("${KEY_LEFT}", Keys.LEFT);
    value = value.replace("${KEY_UP}", Keys.UP);
    value = value.replace("${KEY_RIGHT}", Keys.RIGHT);
    value = value.replace("${KEY_DOWN}", Keys.DOWN);
    value = value.replace("${KEY_PAGE_UP}", Keys.PAGE_UP);
    value = value.replace("${KEY_PGUP}", Keys.PAGE_UP);
    value = value.replace("${KEY_PAGE_DOWN}", Keys.PAGE_DOWN);
    value = value.replace("${KEY_PGDN}", Keys.PAGE_DOWN);
    value = value.replace("${KEY_END}", Keys.END);
    value = value.replace("${KEY_HOME}", Keys.HOME);

    value = value.replace("${KEY_NUMPAD0}", Keys.NUMPAD0);
    value = value.replace("${KEY_N0}", Keys.NUMPAD0);
    value = value.replace("${KEY_NUMPAD1}", Keys.NUMPAD1);
    value = value.replace("${KEY_N1}", Keys.NUMPAD1);
    value = value.replace("${KEY_NUMPAD2}", Keys.NUMPAD2);
    value = value.replace("${KEY_N2}", Keys.NUMPAD2);
    value = value.replace("${KEY_NUMPAD3}", Keys.NUMPAD3);
    value = value.replace("${KEY_N3}", Keys.NUMPAD3);
    value = value.replace("${KEY_NUMPAD4}", Keys.NUMPAD4);
    value = value.replace("${KEY_N4}", Keys.NUMPAD4);
    value = value.replace("${KEY_NUMPAD5}", Keys.NUMPAD5);
    value = value.replace("${KEY_N5}", Keys.NUMPAD5);
    value = value.replace("${KEY_NUMPAD6}", Keys.NUMPAD6);
    value = value.replace("${KEY_N6}", Keys.NUMPAD6);
    value = value.replace("${KEY_NUMPAD7}", Keys.NUMPAD7);
    value = value.replace("${KEY_N7}", Keys.NUMPAD7);
    value = value.replace("${KEY_NUMPAD8}", Keys.NUMPAD8);
    value = value.replace("${KEY_N8}", Keys.NUMPAD8);
    value = value.replace("${KEY_NUMPAD9}", Keys.NUMPAD9);
    value = value.replace("${KEY_N9}", Keys.NUMPAD9);
    value = value.replace("${KEY_ADD}", Keys.ADD);
    value = value.replace("${KEY_NUM_PLUS}", Keys.ADD);
    value = value.replace("${KEY_DECIMAL}", Keys.DECIMAL);
    value = value.replace("${KEY_NUM_PERIOD}", Keys.DECIMAL);
    value = value.replace("${KEY_DIVIDE}", Keys.DIVIDE);
    value = value.replace("${KEY_NUM_DIVISION}", Keys.DIVIDE);
    value = value.replace("${KEY_MULTIPLY}", Keys.MULTIPLY);
    value = value.replace("${KEY_NUM_MULTIPLY}", Keys.MULTIPLY);
    value = value.replace("${KEY_SEPARATOR}", Keys.SEPARATOR);
    value = value.replace("${KEY_SEP}", Keys.SEPARATOR);
    value = value.replace("${KEY_SUBTRACT}", Keys.SUBTRACT);
    value = value.replace("${KEY_NUM_MINUS}", Keys.SUBTRACT);

    value = value.replace("${KEY_F1}", Keys.F1);
    value = value.replace("${KEY_F2}", Keys.F2);
    value = value.replace("${KEY_F3}", Keys.F3);
    value = value.replace("${KEY_F4}", Keys.F4);
    value = value.replace("${KEY_F5}", Keys.F5);
    value = value.replace("${KEY_F6}", Keys.F6);
    value = value.replace("${KEY_F7}", Keys.F7);
    value = value.replace("${KEY_F8}", Keys.F8);
    value = value.replace("${KEY_F9}", Keys.F9);
    value = value.replace("${KEY_F10}", Keys.F10);
    value = value.replace("${KEY_F11}", Keys.F11);
    value = value.replace("${KEY_F12}", Keys.F12);

    finder.findElement(driver, locator).sendKeys(value);

    return null;//from  w ww. ja va  2 s.  co  m
}

From source file:de.iteratec.iteraplan.webtests.poc.page.interfaces.InterfacesEditElementPage.java

License:Open Source License

/**
 * Selects the direction for a interface relationship
 * @param direction direction enum//from   ww  w. jav  a 2  s. co  m
 * @return current page
 */
public InterfacesEditElementPage setDirection(IFDirection direction) {

    driver.findElement(directionLocator).click();

    switch (direction) {

    case LEFT:
        driver.findElement(directionLocator).sendKeys("<");
        break;

    case RIGHT:
        driver.findElement(directionLocator).sendKeys(">");
        break;

    case BIDIRECTIONAL:
        driver.findElement(directionLocator).sendKeys("<");
        driver.findElement(directionLocator).sendKeys(Keys.DOWN);
        break;

    default:
        driver.findElement(directionLocator).sendKeys("-");
        break;

    }

    return this;
}