Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement


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

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

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

        this.sectionPage.importPackage();

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


    // TODO: this should be a PageObject API
    void deleteAnnotationByID(String id)
    {
        annotationsLabel.deleteAnnotationById(id);
        vp.waitUntilElementIsVisible(By.className("xnotification-done"));
        WebElement delete = getDriver().findElement(By.className("xnotification-done"));
        Assert.assertEquals(XWIKI_ANNOTATION_DELETE_SUCCESS, delete.getText());
        delete.click();
    }
View Full Code Here

        ViewPage vp = new ViewPage();
        // TODO: this should be a PageObject API
        vp.waitUntilElementIsVisible(By.className("xnotification-warning"));
        // TODO: this should be a PageObject API
        WebElement warning = getDriver().findElement(By.className("xnotification-warning"));
        Assert.assertEquals(XWIKI_SYNTAX_1_WARNING, warning.getText());

        adminPage.gotoPage();
        annotationsAdminPage = adminPage.clickAnnotationsSection();
        annotationsAdminPage.activateAnnotations();
        annotationsAdminPage.displayAnnotationsByDefault();
        annotationsAdminPage.displayAnnotationsHighlightByDefault();
        annotationsAdminPage.clickSave();

        getUtil().gotoPage(SPACE_NAME, DOC_NAME);
        // Landing directly on this page might result in notification not to be displayed
        getDriver().navigate().refresh();
        // TODO: this should be a PageObject API
        vp.waitUntilElementIsVisible(By.id("body"));

        vp = new ViewPage();
        // TODO: this should be a PageObject API
        vp.waitUntilElementIsVisible(By.className("xnotification-warning"));
        // TODO: this should be a PageObject API
        warning = getDriver().findElement(By.className("xnotification-warning"));
        Assert.assertEquals(XWIKI_SYNTAX_1_WARNING, warning.getText());
    }
View Full Code Here

    }

    public String getAnnotationIdByText(String searchText)
    {
        waitUntilElementIsVisible(By.xpath("//span[contains(.,'" + searchText + "')]"));
        WebElement annotation = getDriver().findElement(By.xpath("//span[contains(.,'" + searchText + "')]"));
        String classId = annotation.getAttribute("class");
        classId = classId.split("\\s+")[1];
        return classId;
    }
View Full Code Here

     *
     * @param language the language to use, should be a valid language, e.g. "en"
     */
    private void checkLanguageTagsArePresent(String language)
    {
        WebElement html = getDriver().findElement(By.tagName("html"));
        Assert.assertEquals(language, html.getAttribute("lang"));
        Assert.assertEquals(language, html.getAttribute("xml:lang"));

        ViewPage vp = new ViewPage();
        Assert.assertEquals("locale=" + language, vp.getMetaDataValue("gwt:property"));
        Assert.assertEquals(language, vp.getMetaDataValue("language"));

View Full Code Here

    {
        showAnnotationByText(searchText);
        waitUntilElementIsVisible(By.xpath("//div[@class='annotationText']/p"));
        String annotationContent = getDriver().findElement(By.xpath(
            "//*[@class='annotation-bubble']//div[@class='annotationText']/p")).getText();
        WebElement body = getDriver().findElement(By.id("body"));
        body.sendKeys(Keys.ESCAPE);
        waitUntilElementDisappears(By.className("annotation-box-view"));
        return annotationContent;
    }
View Full Code Here

        // get the links to existing templates, navigate to each of them and disable the current space
        List<String> spacesToExclude = new ArrayList<String>();
        spacesToExclude.add(space);
        List<WebElement> existingTemplatesLinks = sectionPage.getExistingTemplatesLinks();
        for (int i = 0; i < existingTemplatesLinks.size(); i++) {
            WebElement link = existingTemplatesLinks.get(i);
            link.click();
            ViewPage templateViewPage = new ViewPage();
            templateViewPage.editInline();
            TemplateProviderInlinePage providerEditPage = new TemplateProviderInlinePage();
            providerEditPage.excludeSpaces(spacesToExclude);
            providerEditPage.clickSaveAndView();
View Full Code Here

    public void filterColumn(String inputId, String filterValue)
    {
        // Reset the livetable status since the filtering will cause a reload
        clearStatus();
        WebElement element = getDriver().findElement(By.id(inputId));
        element.sendKeys(filterValue);
        waitUntilReady();
    }
View Full Code Here

        // Thus FTM we have to use getDriver().findElement().

        // For some unknown reason sometimes the menuId cannot be found so wait for it to be visible before finding it.
        waitUntilElementIsVisible(By.id(menuId));

        WebElement menuDiv = getDriver().findElement(By.id(menuId));
        getDriver().executeScript("showsubmenu(arguments[0])", menuDiv);

        // We wait for the submenu to be visible before carrying on to ensure that after this method returns the
        // calling code can access submenu items.
        waitUntilElementIsVisible(By.xpath("//div[@id = '" + menuId + "']//span[contains(@class, 'submenu')]"));
View Full Code Here

     *
     * @since 2.6RC1
     */
    public void clickWantedLink(String spaceName, String pageName, boolean waitForTemplateDisplay)
    {
        WebElement brokenLink =
            getDriver().findElement(
                By.xpath("//span[@class='wikicreatelink']/a[contains(@href,'/create/" + spaceName + "/" + pageName
                    + "')]"));
        brokenLink.click();
        if (waitForTemplateDisplay) {
            // Ensure that the template choice popup is displayed. Since this is done using JS we need to wait till
            // it's displayed. For that we wait on the Create button since that would mean the template radio buttons
            // will all have been displayed.
            waitUntilElementIsVisible(By.xpath("//div[@class='modal-popup']//input[@type='submit']"));
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.