Class RadioInput
- java.lang.Object
-
- com.github.loyada.jdollarx.highlevelapi.RadioInput
-
public class RadioInput extends Object
High-level API to define and interact with. High level API's are not optimized. A definition of an element may interact with the browser to understand the structure of the DOM.
-
-
Constructor Summary
Constructors Constructor Description RadioInput(InBrowser browser, ElementProperty... props)
a radio input with some propertiesRadioInput(InBrowser browser, Path thePath)
a radio button input with the given path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSelected()
is it currently selected?void
select()
Ensure it is selectedString
toString()
static RadioInput
withLabeledText(InBrowser browser, String labelText)
create and return a RadioInput, that has a "label" element with the given text.static RadioInput
withTextUnknownDOM(InBrowser browser, String text, int originalImplicitWait, TimeUnit timeUnit)
In case the organization of the DOM is unclear, it will try both labeled input and unlabeled input.static RadioInput
withUnlabeledText(InBrowser browser, String text)
create and return a RadioInput, that has straight text after it (not in a "label" element).
-
-
-
Constructor Detail
-
RadioInput
public RadioInput(InBrowser browser, Path thePath)
a radio button input with the given path. The given path is not validated.- Parameters:
thePath
- the Path of the radio button
-
RadioInput
public RadioInput(InBrowser browser, ElementProperty... props)
a radio input with some properties- Parameters:
props
- the properties of the radio button
-
-
Method Detail
-
withTextUnknownDOM
public static RadioInput withTextUnknownDOM(InBrowser browser, String text, int originalImplicitWait, TimeUnit timeUnit)
In case the organization of the DOM is unclear, it will try both labeled input and unlabeled input. When doing so, it will change the implicit wait temporarily to a small value, and then revert the implicit timeout to the values provided. Use this only if you are not sure about the structure of the DOM.- Parameters:
text
- - the text following the radio buttonoriginalImplicitWait
- - the current implicit waittimeUnit
- - the current time unit of the implicit wait- Returns:
- a RadioInput instance
-
withLabeledText
public static RadioInput withLabeledText(InBrowser browser, String labelText)
create and return a RadioInput, that has a "label" element with the given text. Note that this is not a pure declaration and it looks for the label in the browser.- Parameters:
labelText
- - the text in the label- Returns:
- - a RadioInput instance
-
withUnlabeledText
public static RadioInput withUnlabeledText(InBrowser browser, String text)
create and return a RadioInput, that has straight text after it (not in a "label" element). i.e.:Male
Female
- Parameters:
text
- - the text following the radio button- Returns:
- - a RadioInput instance
-
isSelected
public boolean isSelected()
is it currently selected?- Returns:
- whether this radio button is selected
-
select
public void select()
Ensure it is selected
-
-