Package org.openqa.selenium

Examples of org.openqa.selenium.By


    /**
     * @since 3.2M1
     */
    public void waitUntilRowCountGreaterThan(final int minimalExpectedRowCount)
    {
        final By by = By.xpath("//tbody[@id = '" + this.livetableId + "-display']//tr");
        getUtil().waitUntilCondition(new ExpectedCondition<Boolean>()
            {
                public Boolean apply(WebDriver driver)
                {
                    return driver.findElements(by).size() >= minimalExpectedRowCount;
View Full Code Here


    /**
     * @since 2.6RC1
     */
    public WYSIWYGEditPage editSection(int sectionNumber)
    {
        By sectionBy = By.xpath("//span[contains(@class, 'edit_section')][" + sectionNumber + "]/a");

        // Since Section Edit links are generated by JS (for XWiki Syntax 2.0) after the page has loaded make sure
        // we wait for them.
        waitUntilElementIsVisible(sectionBy);

View Full Code Here

    private WebElement pane;

    public boolean hasVersionWithSummary(String summary)
    {
        List<WebElement> tableEntries = pane.findElements(By.xpath(".//table/tbody/tr"));
        By commentVersionXPath;
        try {
            pane.findElement(By.xpath(".//tr[2]/td/input"));
            commentVersionXPath = By.xpath(".//td[6]");
        } catch (NoSuchElementException e) {
            commentVersionXPath = By.xpath(".//td[4]");
View Full Code Here

        getRightsTable().waitUntilReady();
    }

    public State getGuestRight(Right right)
    {
        final By iconLocator = By.xpath("//tr[@id='unregistered']/td[" + right.getColumnIndex() + "]/img");
        final WebElement icon = getDriver().findElement(iconLocator);
        return State.getButtonState(icon);
    }
View Full Code Here

        return State.getButtonState(icon);
    }

    public State getRight(String entityName, Right right)
    {
        final By iconLocator =
            By.xpath("//*[@id='usersandgroupstable-display']//td[@class='username']/a[contains(@href, '" + entityName
                + "')]/../../td[" + right.getColumnIndex() + "]/img");
        final WebElement icon = getDriver().findElement(iconLocator);
        return State.getButtonState(icon);
    }
View Full Code Here

    public void clickGuestRight(Right right)
    {
        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:
View Full Code Here

     */
    public void clickRight(String entityName, Right right)
    {
        try {
            executeJavascript("window.__oldConfirm = window.confirm; window.confirm = function() { return true; };");
            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();
View Full Code Here

    /**
     * @return the number of attachments in this document.
     */
    public int getNumberOfAttachments()
    {
        By countLocator = By.cssSelector("#Attachmentstab .itemCount");
        return Integer.parseInt(getDriver().findElement(countLocator).getText().replaceAll("[()]", ""));
    }
View Full Code Here

    @Test
    public void testTokens() {
        openTestURL();

        final By debugButton = By.id(CsrfButtonConnector.ID);

        final String debugMessage1 = getDriver().findElement(debugButton)
                .getText();

        getDriver().findElement(By.id(CsrfTokenDisabled.PRESS_ID)).click();
View Full Code Here

    public void testGwtRpc() {
        openTestURL();

        getDriver().findElement(By.id(GwtRpc.BUTTON_ID)).click();

        By label = By.id(GwtRpcButtonConnector.SUCCESS_LABEL_ID);

        waitForElementVisible(label);
        getDriver().findElement(label);
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.By

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.