Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement.click()


     * Toggles visible/invisible the Annotations Tab.
     */
    public void toggleAnnotationsPane()
    {
        WebElement annotationsPane = getDriver().findElement(By.xpath("//div[@id='tmAnnotations']//a[@class='tme']"));
        annotationsPane.click();
        if (this.isVisible == true) {
            this.isVisible = false;
        }
        if (this.isVisible == false) {
            this.isVisible = true;
View Full Code Here


            Assert.fail("Annotation Pane is hidden");
        }
        waitUntilElementIsVisible(By.className("annotationsettings"));
        WebElement checkBox = getDriver().findElement(By.id("annotationsdisplay"));
        if (checkBox.isSelected() == false) {
            checkBox.click();
        }
    }

    /**
     * Un-Checks the "Show Annotations" checkbox.
View Full Code Here

            Assert.fail("Annotation Pane is hidden");
        }
        waitUntilElementIsVisible(By.className("annotationsettings"));
        WebElement checkBox = getDriver().findElement(By.id("annotationsdisplay"));
        if (checkBox.isSelected() == true) {
            checkBox.click();
        }
    }
}
View Full Code Here

        try {
            executeJavascript("window.__oldConfirm = window.confirm; window.confirm = function() { return true; };");
            final By buttonLocator = By.xpath("*//tr[@id='unregistered']/td[" + right.getColumnIndex() + "]/img");
            final WebElement button = getDriver().findElement(buttonLocator);
            State currentState = State.getButtonState(button);
            button.click();
            // Note: Selenium 2.0a4 returns a relative URL when calling getAttribute("src") but since we moved to
            // Selenium 2.0a7 it returns a *full* URL even though the DOM has a relative URL as in:
            // <img src="/xwiki/resources/js/xwiki/usersandgroups/img/allow.png">
            waitUntilElementEndsWithAttributeValue(buttonLocator, "src", currentState.getNextState().imageURL);
        } finally {
View Full Code Here

            final By buttonLocator =
                By.xpath("//*[@id='usersandgroupstable-display']//td[@class='username']/a[contains(@href, '"
                    + entityName + "')]/../../td[" + right.getColumnIndex() + "]/img");
            final WebElement button = getDriver().findElement(buttonLocator);
            State currentState = State.getButtonState(button).getNextState();
            button.click();
            // Note: Selenium 2.0a4 returns a relative URL when calling getAttribute("src") but since we moved to
            // Selenium 2.0a7 it returns a *full* URL even though the DOM has a relative URL as in:
            // <img src="/xwiki/resources/js/xwiki/usersandgroups/img/allow.png">
            waitUntilElementEndsWithAttributeValue(buttonLocator, "src", currentState.imageURL);
        } finally {
View Full Code Here


    @When("I click the add page button")
    public void clickAddPage() {
        final WebElement addPageLink = portal.findElement(By.xpath("//li[@id='addPageButton']/a"));
        addPageLink.click();
        final WebElement pageForm = portal.findElement(By.id("pageForm"));
        assertThat(pageForm.isDisplayed(), equalTo(Boolean.TRUE));
    }

    @When("I enter the title \"$value\"")
View Full Code Here

    }

    @When("I add the page")
    public void submitAddPage() {
        final WebElement updateButton = portal.findElement(By.id("pageMenuUpdateButton"));
        updateButton.click();
        sleep(2000L);
    }

    @Then("the new page with title \"$pageTitle\" is selected")
    public void checkNewPage(String pageTitle) {
View Full Code Here

    @When("I delete the current page")
    public void deleteCurrentPage() {
        final WebElement activePage =
                portal.findElement(By.xpath("//div[@id='pageContent']/nav//li[contains(@class, 'active')]/a"));
        activePage.click();
        sleep(2000L);
        final WebElement deletePageLink = portal.findElement(By.xpath("//li[@id='pageMenuDelete']/a"));
        deletePageLink.click();
        sleep(2000L);
    }
View Full Code Here

        final WebElement activePage =
                portal.findElement(By.xpath("//div[@id='pageContent']/nav//li[contains(@class, 'active')]/a"));
        activePage.click();
        sleep(2000L);
        final WebElement deletePageLink = portal.findElement(By.xpath("//li[@id='pageMenuDelete']/a"));
        deletePageLink.click();
        sleep(2000L);
    }


    private void changeFieldValue(String fieldId, String value) {
View Full Code Here

        get(url);
    }

    public void pressNewAccountButton() {
        final WebElement newAccountButton = findElement(By.id("createNewAccountButton"));
        newAccountButton.click();
    }

    public WebElement getNewAccountForm() {
        return findElement(By.id("newAccountForm"));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.