Package de.bmiag.tapir.htmlbasic.impl
Class DefaultSeleniumSingleSelect
- java.lang.Object
-
- de.bmiag.tapir.selenium.element.AbstractSingleSeleniumElement
-
- de.bmiag.tapir.htmlbasic.impl.DefaultSeleniumSingleSelect
-
- All Implemented Interfaces:
SingleSelect
,SingleWebElementBased
,Displayable
,ElementCollection<SingleSelectOption>
,Enabable
,SingleSelectable<SingleSelectOption>
,TapirElement
@Component("tapirSingleSelect") @Scope("prototype") public class DefaultSeleniumSingleSelect extends AbstractSingleSeleniumElement implements SingleSelect
Default Selenium implementation of aSingleSelect
.
Internally, it wraps the givenWebElement
in aSelect
to obtain helper methods to select and deselect options.- Since:
- 2.0.0
- Author:
- Oliver Libutzki <[email protected]>
-
-
Constructor Summary
Constructors Constructor Description DefaultSeleniumSingleSelect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SingleSelectOption>
findElements(java.util.function.Predicate<? super SingleSelectOption> predicate)
Returns all elements which match the given predicatejava.util.List<SingleSelectOption>
findElementsByLabel(java.lang.String aLabel)
Returns all elements which have the given label.SingleSelectOption
findFirstElement(java.util.function.Predicate<? super SingleSelectOption> predicate)
Returns the first element which matches the given predicateSingleSelectOption
findFirstElementByLabel(java.lang.String aLabel)
Returns the first element which has the given labeljava.util.List<SingleSelectOption>
getElements()
Returns all elementsprotected java.util.List<SingleSelectOption>
getElementsInternal(java.util.function.Predicate<? super SingleSelectOption> predicate, boolean returnOnFirstMatch)
SingleSelectOption
getSelectedElement()
Returns the selected element.boolean
isDisplayed()
Returns true, if the element is displayed.boolean
isEnabled()
Returns true, if the element is enabled.-
Methods inherited from class de.bmiag.tapir.selenium.element.AbstractSingleSeleniumElement
getWebElement, setWebElement
-
-
-
-
Method Detail
-
isDisplayed
public boolean isDisplayed()
Description copied from interface:Displayable
Returns true, if the element is displayed. "Displayed" means it has to be part of the dom and it is not hidden using css.- Specified by:
isDisplayed
in interfaceDisplayable
- Returns:
- true, if the element is displayed.
-
isEnabled
public boolean isEnabled()
Description copied from interface:Enabable
Returns true, if the element is enabled. "enabled" means it is not disabled and not readonly.
-
getElements
public java.util.List<SingleSelectOption> getElements()
Description copied from interface:ElementCollection
Returns all elements- Specified by:
getElements
in interfaceElementCollection<SingleSelectOption>
- Returns:
- all elements
-
getElementsInternal
protected java.util.List<SingleSelectOption> getElementsInternal(java.util.function.Predicate<? super SingleSelectOption> predicate, boolean returnOnFirstMatch)
-
getSelectedElement
public SingleSelectOption getSelectedElement()
Description copied from interface:SingleSelectable
Returns the selected element.- Specified by:
getSelectedElement
in interfaceSingleSelectable<SingleSelectOption>
- Returns:
- the label of the selected value
-
findElements
public java.util.List<SingleSelectOption> findElements(java.util.function.Predicate<? super SingleSelectOption> predicate)
Description copied from interface:ElementCollection
Returns all elements which match the given predicate- Specified by:
findElements
in interfaceElementCollection<SingleSelectOption>
- Parameters:
predicate
- the predicate for finding the elements- Returns:
- all elements which match the given predicate
-
findFirstElement
public SingleSelectOption findFirstElement(java.util.function.Predicate<? super SingleSelectOption> predicate)
Description copied from interface:ElementCollection
Returns the first element which matches the given predicate- Specified by:
findFirstElement
in interfaceElementCollection<SingleSelectOption>
- Parameters:
predicate
- the predicate for selecting the element- Returns:
- all elements which match the given predicate, cannot be null
-
findElementsByLabel
public java.util.List<SingleSelectOption> findElementsByLabel(java.lang.String aLabel)
Description copied from interface:SingleSelect
Returns all elements which have the given label.- Specified by:
findElementsByLabel
in interfaceSingleSelect
- Parameters:
aLabel
- the label for finding the elements- Returns:
- all elements which have the given label.
-
findFirstElementByLabel
public SingleSelectOption findFirstElementByLabel(java.lang.String aLabel)
Description copied from interface:SingleSelect
Returns the first element which has the given label- Specified by:
findFirstElementByLabel
in interfaceSingleSelect
- Parameters:
aLabel
- the label for selecting the element- Returns:
- all elements which have the given label, cannot be null
-
-