Skip to content

TextArea

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

TextArea is a form, which can hold an unlimited number of characters and lines, and the text renders in a fixed-width font.

Example:

TextArea

As TextArea can hold more than one line of text, JDI provides convenient ways of operating with them, such as adding new lines, or getting the whole text.

Here is the list of available methods.

Method Description Return Type
inputLines(String…) Clear textarea and Input several lines of text in textarea void
addNewLine(String) Add text in textarea from new line void
getLines() Get lines of text in textarea String[]
getLines().length Get count of lines in textarea int

Initialization:

@FindBy(xpath = "//text-area xpath")
public TextArea textArea;

Action > Examples:

@Test
public void inputSeveralLinesExample() {
    String[] lines = {"line 1", "line2"};
    textArea.inputLines(lines);
    Assert.assertEquals(textArea.getLines(), lines);
}

See more examples on GitHub

Clone this wiki locally