Skip to content

TextField

Taisiia-Kozlova edited this page Nov 7, 2017 · 3 revisions

TextField – single-line field for various text input: ex. login, password, search criteria, etc.

Example:

TextField

Here is the list of available methods.

Method Description Return Type
input(String) Input text in textfield void
newInput(String) Clear and input text in textfield void
clear() Clear textfield void
focus() Focus (click) on textfield void

TextField Initialization:

@FindBy(xpath = "//text-field xpath")
public TextField textField;

Action > Examples:

@Test
public void textFieldInputExample() {
    String text = "some text";
    textField.input(text);
    Assert.assertEquals(textField.getText(), text);
}

See more examples on GitHub

Clone this wiki locally