Skip to content

Instantly share code, notes, and snippets.

@lfryc
Forked from bleathem/gist:3508270
Created August 29, 2012 08:06
Show Gist options
  • Save lfryc/3508324 to your computer and use it in GitHub Desktop.
Save lfryc/3508324 to your computer and use it in GitHub Desktop.
Graphene Login component
public class LoginComponent {
@Root
private WebElement driver;
@FindBy(id="loginForm:username")
private WebElement usernameInput;
@FindBy(id="loginForm:password")
private WebElement passwordInput;
@FindBy(id="loginForm:login")
private WebElement loginButton;
public void setUsername(Object username) {
usernameInput.sendKeys(username.toString());
}
public void setPassword(Object password) {
passwordInput.sendKeys(password.toString());
}
public void submit() {
loginButton.submit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment