You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taisiia-Kozlova edited this page Nov 7, 2017
·
3 revisions
Text is a combination of letters and textual symbols. When performing testing, text is used in most operations: when typing text into login-field, finding a button with some certain text in it, or checking if actual text matches expected one.
Example:
Here is the list of available methods.
Method
Description
Return Type
getText()
Get element’s text
String
waitText(String)
Wait while element’s text contains expected text. Returns element’s text
String
waitMatchText(String)
Wait while element’s text matches regEx. Returns element’s text
String
Initialization:
@FindBy(xpath = "//text xpath")
publicTexttext;
Action > Examples:
@TestpublicvoidgetTextExample() {
Stringexpected = "this is the text we expect to see";
Stringactual = text.getText();
Assert.assertEquals(actual, expected);
}