Package de.bmiag.tapir.htmlbasic.impl
Class DefaultSeleniumMultiSelect
- java.lang.Object
-
- de.bmiag.tapir.selenium.element.AbstractSingleSeleniumElement
-
- de.bmiag.tapir.htmlbasic.impl.DefaultSeleniumMultiSelect
-
- All Implemented Interfaces:
MultiSelect
,SingleWebElementBased
,Displayable
,ElementCollection<MultiSelectOption>
,Enabable
,MultiSelectable<MultiSelectOption>
,TapirElement
@Component("tapirMultiSelect") @Scope("prototype") public class DefaultSeleniumMultiSelect extends AbstractSingleSeleniumElement implements MultiSelect
Default Selenium implementation of aMultiSelect
.
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 DefaultSeleniumMultiSelect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MultiSelectOption>
findElements(java.util.function.Predicate<? super MultiSelectOption> predicate)
Returns all elements which match the given predicatejava.util.List<MultiSelectOption>
findElementsByLabel(java.lang.String aLabel)
Returns all elements which have the given label.MultiSelectOption
findFirstElement(java.util.function.Predicate<? super MultiSelectOption> predicate)
Returns the first element which matches the given predicateMultiSelectOption
findFirstElementByLabel(java.lang.String aLabel)
Returns the first element which has the given labeljava.util.List<MultiSelectOption>
getElements()
Returns all elementsprotected java.util.List<MultiSelectOption>
getElementsInternal(java.util.function.Predicate<? super MultiSelectOption> predicate, boolean returnOnFirstMatch)
java.util.List<MultiSelectOption>
getSelectedElements()
Returns the selected elements.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.
-
getElementsInternal
protected java.util.List<MultiSelectOption> getElementsInternal(java.util.function.Predicate<? super MultiSelectOption> predicate, boolean returnOnFirstMatch)
-
getElements
public java.util.List<MultiSelectOption> getElements()
Description copied from interface:ElementCollection
Returns all elements- Specified by:
getElements
in interfaceElementCollection<MultiSelectOption>
- Returns:
- all elements
-
getSelectedElements
public java.util.List<MultiSelectOption> getSelectedElements()
Description copied from interface:MultiSelectable
Returns the selected elements.- Specified by:
getSelectedElements
in interfaceMultiSelectable<MultiSelectOption>
- Returns:
- the selected elements
-
findElements
public java.util.List<MultiSelectOption> findElements(java.util.function.Predicate<? super MultiSelectOption> predicate)
Description copied from interface:ElementCollection
Returns all elements which match the given predicate- Specified by:
findElements
in interfaceElementCollection<MultiSelectOption>
- Parameters:
predicate
- the predicate for finding the elements- Returns:
- all elements which match the given predicate
-
findFirstElement
public MultiSelectOption findFirstElement(java.util.function.Predicate<? super MultiSelectOption> predicate)
Description copied from interface:ElementCollection
Returns the first element which matches the given predicate- Specified by:
findFirstElement
in interfaceElementCollection<MultiSelectOption>
- Parameters:
predicate
- the predicate for selecting the element- Returns:
- all elements which match the given predicate, cannot be null
-
findElementsByLabel
public java.util.List<MultiSelectOption> findElementsByLabel(java.lang.String aLabel)
Description copied from interface:MultiSelect
Returns all elements which have the given label.- Specified by:
findElementsByLabel
in interfaceMultiSelect
- Parameters:
aLabel
- the label for finding the elements- Returns:
- all elements which have the given label.
-
findFirstElementByLabel
public MultiSelectOption findFirstElementByLabel(java.lang.String aLabel)
Description copied from interface:MultiSelect
Returns the first element which has the given label- Specified by:
findFirstElementByLabel
in interfaceMultiSelect
- Parameters:
aLabel
- the label for selecting the element- Returns:
- all elements which have the given label, cannot be null
-
-