Skip to content

Instantly share code, notes, and snippets.

@rgr2k
Created August 6, 2012 19:58
Show Gist options
  • Select an option

  • Save rgr2k/3277979 to your computer and use it in GitHub Desktop.

Select an option

Save rgr2k/3277979 to your computer and use it in GitHub Desktop.
BotStyletests
* Type something into an input field. WebDriver doesn't normally clear these
<rgr> * before typing, so this method does that first. It also sends a return key
<rgr> * to move the focus out of the element.
<rgr> */
<rgr> public void type(By locator, String text) {
<rgr> WebElement element = driver.findElement(locator);
<rgr> element.clear();
<rgr> element.sendKeys(text + "\n");
<rgr> }
<rgr> }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment