Skip to content

DatePicker

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

DatePicker – a type of text-field that only allows date-format input with separator-symbols, depending on the implementation, such as “.” and “/”, etc.

Example:

DataPicker

JDI enables simple ways of interaction with text-fields, such as text input, text removal and cursor focus on chosen field.

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

DatePicker Initialization:

@FindBy(xpath = "//date-picker xpath")
public DatePicker datePicker;

Action > Examples:

@Test
public void clearDatePickerExample() {
    Assert.assertTrue(!datePicker.getText().equals("")
    datePicker.clear();
}

See more examples on GitHub

Clone this wiki locally