Package org.openqa.selenium

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


    }


    private void changeFieldValue(String fieldId, String value) {
        final WebElement field = portal.findElement(By.id(fieldId));
        field.clear();
        field.sendKeys(value);
    }

    private void sleep(long milis) {
        try {
View Full Code Here


        WebElement cell = browser.findElement(ByJQuery.selector(".rf-edt-c-column2 .rf-edt-c-cnt:last"));
        Assert.assertEquals("6", cell.getText());

        WebElement filterInput = browser.findElement(By.id("myForm:edt:filterInput"));
        filterInput.clear();
        filterInput.sendKeys("3");
        guardAjax(filterInput).sendKeys(Keys.TAB);
        Graphene.waitAjax().until().element(ByJQuery.selector(".rf-edt-c-column2 .rf-edt-c-cnt:last")).text().equalTo("3");

        // when / then
View Full Code Here

        List<WebElement> cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Number of rows present", 10, cells.size());

        final WebElement filterInput = browser.findElement(By.id("myForm:edt:column2:flt"));
        filterInput.clear();
        filterInput.sendKeys("3");
        Warp.initiate(new Activity() {
            @Override
            public void perform() {
                filterInput.sendKeys(Keys.TAB);
View Full Code Here

        List<WebElement> cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Value of the first cell of the second column", "3", cells.get(0).getText());
        Assert.assertEquals("Number of rows present", 10, cells.size());

        WebElement filterInput = browser.findElement(By.id("myForm:edt:column2:flt"));
        filterInput.clear();
        filterInput.sendKeys("3");
        guardAjax(filterInput).sendKeys(Keys.TAB);
        cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
        Assert.assertEquals("Value of the first cell of the second column", "3", cells.get(0).getText());
        Assert.assertEquals("Number of rows present", 4, cells.size());
View Full Code Here

    public void testClosePopupRetainText_selectingAValue() throws Exception {
        openTestURL();
        ComboBoxElement cb = $(ComboBoxElement.class).first();
        cb.selectByText("Item 3");
        WebElement textbox = cb.findElement(By.vaadin("#textbox"));
        textbox.clear();
        textbox.sendKeys("I");
        cb.openPopup();
        // Entered value should remain in the text field even though the popup
        // is opened
        assertEquals("I", textbox.getAttribute("value"));
View Full Code Here

        openTestURL();

        WebElement element = $(ComboBoxElement.class).first().findElement(
                By.vaadin("#textbox"));
        ((TestBenchElementCommands) element).click(8, 7);
        element.clear();
        element.sendKeys("New value");
        assertEquals("New value", element.getAttribute("value"));
        if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
            new Actions(getDriver()).sendKeys(Keys.ENTER).perform();
            Thread.sleep(500);
View Full Code Here

        dateTextbox.sendKeys("lala", Keys.TAB);
        assertLogText("3. valueChange: value: null, is valid: false");
        button.click();
        assertLogText("4. buttonClick: value: null, is valid: false");

        dateTextbox.clear();
        dateTextbox.sendKeys("02/02/02", Keys.TAB);
        assertLogText("5. valueChange: value: 02/02/02, is valid: true");
        button.click();
        assertLogText("6. buttonClick: value: 02/02/02, is valid: true");
    }
View Full Code Here

  /**
   * 在Element中输入文本内容.
   */
  public void type(By by, String text) {
    WebElement element = driver.findElement(by);
    element.clear();
    element.sendKeys(text);
  }

  /**
   * 点击Element.
 
View Full Code Here

            return resultEl.findElements(By.tagName("button")).get(1);
        }
       
        public void setName(String name) {
            WebElement nameInput = getNameInput();
            nameInput.clear();
            nameInput.sendKeys(name);
        }

        public void setTags(String tags) {
            WebElement tagsInput = getTagsInput();
View Full Code Here

            nameInput.sendKeys(name);
        }

        public void setTags(String tags) {
            WebElement tagsInput = getTagsInput();
            tagsInput.clear();
            tagsInput.sendKeys(tags);
        }

        public void setDescription(String description) {
            WebElement descriptionInput = getDescriptionInput();
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.