List of usage examples for org.openqa.selenium WebElement clear
void clear();
From source file:cn.hxh.springside.test.functional.Selenium2.java
License:Apache License
/** * Element.//from ww w.j av a2 s . c o m */ public void type(By by, String text) { WebElement element = driver.findElement(by); element.clear(); element.sendKeys(text); }
From source file:cn.newtouch.util.test.utils.SeleniumUtils.java
License:Apache License
/** * Selnium1.0./* w w w .j ava 2 s . c om*/ */ public static void type(WebElement element, String text) { element.clear(); element.sendKeys(text); }
From source file:co.flexmod.selenium.example.integration.HelloWorldPage.java
License:Apache License
public void setNameValue(String value) { WebElement txtName = webDriver.findElement(By.id(TXT_NAME)); txtName.clear(); txtName.sendKeys(value); }
From source file:com.atomicleopard.webelemental.Element.java
License:Open Source License
public Element val(CharSequence value) { for (WebElement element : elements) { element.clear(); element.sendKeys(value);//from w w w .j a va2 s . c o m } return this; }
From source file:com.atomicleopard.webelemental.Element.java
License:Open Source License
public Element text(CharSequence value) { for (WebElement element : elements) { element.clear(); element.sendKeys(value);/*from w w w .j av a 2 s.com*/ } return this; }
From source file:com.autocognite.selenium.lib.SeleniumWebUiDriver.java
License:Apache License
public void setText(WebElement wdElement, String text) throws Exception { this.waitForElementClickability(wdElement); wdElement.click();//from w w w. jav a 2 s .c om wdElement.clear(); wdElement.sendKeys(text); }
From source file:com.autocognite.selenium.lib.SeleniumWebUiDriver.java
License:Apache License
public void clearText(WebElement wdElement) throws Exception { wdElement.clear(); }
From source file:com.axatrikx.webdriver.AxaDriver.java
License:Apache License
/** * Type on the element. If some text is already present on it, it will be * cleared before typing. For typing over existing data, use sendKeys * method.// w w w . j a v a 2s . c o m * * @param locator * string locator in OR locator format * @param keysToType * text to type */ public void type(String locator, String keysToType) { WebElement ele = eleHelper.findElement(locator); ele.clear(); ele.sendKeys(keysToType); reporter.log("Action", "Typed '" + keysToType + "' on element " + locator, ExecutionStatus.INFO); }
From source file:com.cengage.mindtap.keywords.SVRPageActions.java
public void studentSubmitsAnswersToActivity(String answer) { switchToMediaName(); //switchToMainIFrame(); switchToActiveServiceCXPFrame();/* w ww . j a v a2 s . c o m*/ waitForElementPresent("By.xpath(//li[@heading='Questions'])"); WebElement answerBox; for (int i = 0; i < 3; i++) { answerBox = driver .findElement(By.xpath("//div[@id='section1_assessment1_question_" + i + "']//nobr/textarea")); answerBox.click(); answerBox.clear(); answerBox.sendKeys(answer); waitTOSync();// for answers to be uploaded on SVR server } element("submitBtn").click(); for (int i = 1; i < 5; i++) { waitTOSync(); } //waitForElementDisplayed(By.xpath("(//div[@class='ci-feedback-title'])[1]")) deselectFrame(); }
From source file:com.cengage.mindtap.keywords.youSeeUPageActions.java
private void insertDataInMatrix() { int j = 1, k = 1; WebElement textBoxLocator, textBoxPoints; for (int i = 0; i < 3; i++) { while (j < 5) { textBoxLocator = driver//www. j av a 2 s .com .findElement(By.xpath("//textarea[@id='casestudy_designerbundle_rubric_type_rows_" + i + "_cells_" + j + "_description']")); textBoxLocator.click(); textBoxLocator.clear(); textBoxLocator.sendKeys("automation :" + i + j); j += 1; } while (k < 5) { textBoxPoints = driver .findElement(By.xpath("//input[@id='casestudy_designerbundle_rubric_type_rows_" + i + "_cells_" + k + "_points']")); textBoxPoints.click(); textBoxPoints.clear(); textBoxPoints.sendKeys("10"); k += 1; } j = 0; k = 1; } }