Package org.openqa.selenium

Examples of org.openqa.selenium.By


     * @param name category name, must exist
     */
    public void deleteCategory(String name)
    {
        // click delete button
        By deletePath =
            By.xpath("//a[@class='tool delete' and contains(@href, '" + getUtil().escapeURL(name) + "')]/img");
        hoverCategoryItem(name);
        waitUntilElementIsVisible(deletePath);
        getDriver().findElement(deletePath).click();

View Full Code Here


     * @param toName target category name, must not exist
     */
    public void renameCategory(String fromName, String toName)
    {
        // show the rename form
        By renamePath =
            By.xpath("//a[@class='tool rename' and contains(@href, '" + getUtil().escapeURL(fromName) + "')]/img");
        hoverCategoryItem(fromName);
        waitUntilElementIsVisible(renamePath);
        getDriver().findElement(renamePath).click();
        waitUntilElementIsVisible(By.className("category-rename-form"));
View Full Code Here

     *
     * @param name category name, must exist
     */
    private void hoverCategoryItem(String name)
    {
        By locator =
            By.xpath("//a[@class='tool delete' and contains(@href, '" + getUtil().escapeURL(name)
                + "')]/ancestor::span[@class='blog-category-tools']");
        makeElementVisible(locator);
    }
View Full Code Here

        this.propertySubmit.click();
    }

    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
View Full Code Here

    }

    public DatabaseListClassEditElement getDatabaseListClassEditElement(String propertyName)
    {
        // Make the element visible before returning it
        By locator = By.id("xproperty_" + propertyName + "_title");
        waitUntilElementIsVisible(locator);
        getDriver().findElement(locator).click();
        return new DatabaseListClassEditElement(getForm(), propertyName);
    }
View Full Code Here

    }

    public StaticListClassEditElement getStaticListClassEditElement(String propertyName)
    {
        // Make the element visible before returning it
        By locator = By.id("xproperty_" + propertyName + "_title");
        waitUntilElementIsVisible(locator);
        getDriver().findElement(locator).click();
        return new StaticListClassEditElement(getForm(), propertyName);
    }
View Full Code Here

    }

    public NumberClassEditElement getNumberClassEditElement(String propertyName)
    {
        // Make the element visible before returning it
        By locator = By.id("xproperty_" + propertyName + "_title");
        waitUntilElementIsVisible(locator);
        getDriver().findElement(locator).click();
        return new NumberClassEditElement(getForm(), propertyName);
    }
View Full Code Here

    public FormElement addObject(String className)
    {
        getForm().setFieldValue(this.classNameField, className);

        final By objectsLocator = By.cssSelector("[id='xclass_" + className + "'] .xobject");
        final int initialObjectCount = getUtil().findElementsWithoutWaiting(getDriver(), objectsLocator).size();
        this.classNameSubmit.click();

        // Make sure we wait for the element to appear since there's no page refresh.
        getUtil().waitUntilCondition(new ExpectedCondition<Boolean>()
View Full Code Here

        return objects.get(objects.size() - 1);
    }

    public FormElement addObjectFromInlineLink(String className)
    {
        final By objectsLocator = By.cssSelector("[id='xclass_" + className + "'] .xobject");
        final int initialObjectCount = getDriver().findElements(objectsLocator).size();

        getDriver().findElement(By.cssSelector("[id='add_xobject_" + className + "'] .xobject-add-control")).click();

        // Make sure we wait for the element to appear since there's no page refresh.
View Full Code Here

        return objects.get(objects.size() - 1);
    }

    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
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.