TextBox Methods
ClickOutOfBox
Clicks out of the TextBox, slightly to the left, to take away the focus of the box.
Syntax:
Enter
Clicks in the textbox (using Hotspot of the location image), selects all and types the text.
Supports empty text (= delete) and multiple lines (use \n
).
If ClickOutAfterType is true, it clicks in the top left corner of the location image to take focus away from textbox.
The text that is entered is verified to ensure the complete text was correctly entered. If the verify fails, the configured amount of retries (RetryCount) are performed.
Syntax:
Parameters:
Parameter
Description
textToEnter
Type: String The text that shall be typed into the textbox.
Exceptions:
Exception
Condition
When the TextBox could not be found on the screen.
When the text could not be entered successfully even after the retries.
EnterWithoutVerification
Enters text in a textbox but does not verify if anything was entered at all. Only use this if there is really no way to verify the enterd text with Enter. For blind password entry use PwTextBox.Enter() instead which at least verifies that the correct number of characters were entered
Syntax:
Parameters:
Parameter
Description
textToEnter
Type: String The text that shall be typed into the textbox.
Exceptions:
Exception
Condition
When the TextBox could not be found on the screen.
GetText
Copies or reads the text from TextBox (depending on the TextBoxType) and returns it as string.
NOTE: Might not work correctly with empty textboxes (esp. for TextBoxType Clipboard)! If textbox is expected to be empty, use VerifyText("")
before GetText()
to check if it is empty.
Syntax:
Return Value:
The string read from the TextBox.
Exceptions:
Exception
Condition
When the TextBox could not be found on the screen.
PasteText
Pastes the text from the clipboard on the SUT to the text box. Overwrites what was in the text box before.
Syntax:
Exceptions:
Exception
Condition
When the TextBox could not be found on the screen.
When the text could not be pasted successfully even after the retries.
VerifyText
Overload List
Name
Description
Verifies if the text in the textbox is the same as the provided text. If not, provides the actual text read from the Textbox in actualText
Verifies if the text in the textbox is the same as the provided text.
VerifyText(String, String)
Verifies if the text in the textbox is the same as the expectedText. If not, provides the actual text read from the Textbox in actualText.
Syntax:
Parameters:
Return Value:
true, if the expected Text could be found in the text box, false otherwise.
Exceptions:
Exception
Condition
When the TextBox could not be found on the screen.
VerifyText(String)
Verifies if the text in the textbox is the same as the expectedText.
Syntax:
Parameters:
Parameter
Description
expectedText
Type: String The expected text.
Return Value:
true, if the expected Text could be found in the text box, false otherwise.
Exceptions:
Exception
Condition
When the TextBox could not be found on the screen.
Last updated