Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement


     *
     * @return the pane used to select an attached image to insert
     */
    public AttachedImageSelectPane clickInsertAttachedImageMenu()
    {
        WebElement insertAttachedImageMenu =
            container.findElement(By.xpath("//td[contains(@class, 'gwt-MenuItem') and . = 'Attached Image...']"));
        if (!isMenuEnabled(insertAttachedImageMenu)) {
            return null;
        }
        insertAttachedImageMenu.click();
        return new AttachedImageSelectPane().waitToLoad();
    }
View Full Code Here


     *
     * @param label the label of the menu item to click
     */
    private void clickMenuWithLabel(String label)
    {
        WebElement menu =
            container.findElement(By.xpath("//td[contains(@class, 'gwt-MenuItem') and . = '" + label + "']"));
        menu.click();
    }
View Full Code Here

                public WebElement apply(WebDriver driver)
                {
                    try {
                        getContainer(driver).findElement(
                            By.xpath("//div[@class = 'gwt-TabBarItem gwt-TabBarItem-selected']/div[. = 'Source']"));
                        WebElement sourceTextArea = getContainer(driver).findElement(By.className("xPlainTextEditor"));
                        return sourceTextArea.isEnabled() ? sourceTextArea : null;
                    } catch (NotFoundException sourceNotFound) {
                        WebElement richTextEditor = getContainer(driver).findElement(By.className("xRichTextEditor"));
                        try {
                            richTextEditor.findElement(By.className("loading"));
                            return null;
                        } catch (NotFoundException loadingNotFound) {
                            return richTextEditor;
                        }
                    }
View Full Code Here

        List<String> columnEntries = new ArrayList<String>();
        List<WebElement> column = getTable().getColumn(columnName);
        for (WebElement cell : column) {
            if (cell.getText().equals(value)) {
                // Get the Subject element in the same row and look inside for a link.
                WebElement link = getUtil().findElementsWithoutWaiting(getDriver(),
                    getTable().getColumn("Subject").get(column.indexOf(cell)), By.tagName("a")).get(0);
                link.click();
                return null;
            }
            columnEntries.add(cell.getText());
        }
        throw new WebDriverException("Could not find message with " + column + " equal to "
View Full Code Here

    }

    public void deleteProperty(String propertyName)
    {
        final By propertyLocator = By.id("xproperty_" + propertyName);
        final WebElement propertyContainer = getDriver().findElement(propertyLocator);
        WebElement deleteLink = propertyContainer.findElement(By.className("delete"));
        deleteLink.click();

        // Expect a confirmation box
        waitUntilElementIsVisible(By.className("xdialog-box-confirmation"));
        getDriver().findElement(By.cssSelector(".xdialog-box-confirmation input[value='Yes']")).click();
        waitUntilElementDisappears(propertyLocator);
View Full Code Here

    }

    public void deleteObject(String className, int index)
    {
        final By objectLocator = By.id("xobject_" + className + "_" + index);
        final WebElement objectContainer = getDriver().findElement(objectLocator);
        WebElement deleteLink = objectContainer.findElement(By.className("delete"));
        deleteLink.click();

        // Expect a confirmation box
        waitUntilElementIsVisible(By.className("xdialog-box-confirmation"));
        getDriver().findElement(By.cssSelector(".xdialog-box-confirmation input[value='Yes']")).click();
        waitUntilElementDisappears(objectLocator);
View Full Code Here

            .findElements(By.className("xobject-title"));
        List<WebElement> elements = getDriver().findElement(By.id("xclass_" + className))
            .findElements(By.className("xobject-content"));
        List<FormElement> forms = new ArrayList<FormElement>(elements.size());
        for (int i = 0; i < elements.size(); i++) {
            WebElement element = elements.get(i);
            // Make sure all forms are displayed otherwise we can't interact with them.
            if (!element.isDisplayed()) {
                titles.get(i).click();
            }
            forms.add(new FormElement(element));
        }
        return forms;
View Full Code Here

        return new TemplateProviderInlinePage();
    }

    public List<WebElement> getExistingTemplatesLinks()
    {
        WebElement availableTemplatesHeader = getDriver().findElement(By.id("HAvailableTemplateProviders"));
        // a bit unreliable here, but it's the best I can do
        WebElement ul = availableTemplatesHeader.findElement(By.xpath("following-sibling::node()"));
        return ul.findElements(By.tagName("a"));
    }
View Full Code Here

    @Test
    public void testDeletePageCanDoRedirect()
    {
        HomePage homePage = new HomePage();
        getUtil().gotoPage(SPACE_VALUE, PAGE_VALUE, DELETE_ACTION, "xredirect=" + homePage.getURL());
        WebElement yesButton = getDriver().findElement(By.xpath("//input[@value='yes']"));
        yesButton.click();
        Assert.assertTrue(homePage.isOnHomePage());
    }
View Full Code Here

        URL fileUrl = this.getClass().getResource("/administration/" + BACKUP_PACKAGE);

        this.sectionPage.attachPackage(fileUrl);
        this.sectionPage.selectPackage(BACKUP_PACKAGE);

        WebElement importAsBackup = getDriver().findElement(By.name("importAsBackup"));
        Assert.assertTrue(importAsBackup.isSelected());

        this.sectionPage.importPackage();

        ViewPage importedPage = this.sectionPage.clickImportedPage("Main.TestPage");
View Full Code Here

TOP

Related Classes of org.openqa.selenium.WebElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.