Inputs¶
-
public final class
Inputs
¶ High-level API to define and interact with various input elements. High level API’s are not optimized. A definition of an element may interact with the browser to understand the structure of the DOM.
Methods¶
changeInputValue¶
-
public static void
changeInputValue
(InBrowser browser, Path field, String text)¶ Change input value: clear it and then enter another text in it
Parameters: - browser – the browser
- field – Path to the input field
- text – the text to enter in the input field
Throws: - OperationFailedException – failed to perform the operation
changeInputValueWithEnter¶
-
public static void
changeInputValueWithEnter
(InBrowser browser, Path field, String text)¶ Similar to changeInputValue, but adds an ENTER after setting the value of the input
Parameters: - browser – the browser
- field – Path to the input field
- text – the text to enter in the input field
Throws: - OperationFailedException – failed to perform the operation
checkboxType¶
clearInput¶
inputFollowedByUnlabeledText¶
inputForLabel¶
-
public static Path
inputForLabel
(InBrowser browser, String labelText)¶ A lazy way to find an input based on the label. Mote that unlike It looks for a label element that has an ID. If it finds one, it returns a Path to an input with that ID. Otherwise it returns a Path to an input inside the label element.
Parameters: - browser – the browser
- labelText – the label to look for
Returns: a Path to the input, on a best effort basis
radioType¶
selectInFieldWithLabel¶
-
public static Path
selectInFieldWithLabel
(InBrowser browser, String labelText, String option)¶ Perform a selection of an option in a select element. It expects to find the label element with the given text before the select element
Parameters: - browser – the browser
- labelText – The text of the select label
- option – The option text
Returns: the Path of the select element