Class AutoComplete
java.lang.Object
org.primefaces.selenium.AbstractPrimePageFragment
org.primefaces.selenium.component.base.AbstractComponent
org.primefaces.selenium.component.base.AbstractInputComponent
org.primefaces.selenium.component.AutoComplete
- All Implemented Interfaces:
org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
Component wrapper for the PrimeFaces
p:autoComplete.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates search behaviorvoidAdds an item to the input field.voidclear()Clears the Autocomplete input and guards AJAX for "clear" event.voidDeactivates search behaviorintgetDelay()Delay to wait in milliseconds before sending each query to the server.org.openqa.selenium.WebElementorg.openqa.selenium.WebElementgetInput()The input element reference.org.openqa.selenium.WebElementgetItems()org.openqa.selenium.WebElementgetPanel()List<org.openqa.selenium.WebElement>Gets the actual token elements in mutliple mode.getValue()If using multiple mode gets the values of the tokens.voidhide()Hides the AutoComplete-Panel.booleanIs the input using AJAX "clear" event?booleanIs the input using AJAX "itemSelect" event?booleanIs the input using AJAX "itemUnselect" event?booleanIs the input using AJAX "query" event?voidremoveItem(String item) Removes an item from the input field.voidExecute the AutoComplete search.voidSends the Tab-Key to jump to the next input.voidSets the value and presses tab afterwards.intsetValueWithoutTab(Serializable value) Sets the value without pressing tab afterwards.voidshow()Shows the AutoComplete-Panel.voidWaits until the AutoComplete-Panel containing the suggestions shows up.Methods inherited from class org.primefaces.selenium.component.base.AbstractInputComponent
copyToClipboard, disable, enable, getAssignedLabel, getAssignedLabelText, isEnabled, isOnchangeAjaxified, pasteFromClipboard, selectAllTextMethods inherited from class org.primefaces.selenium.component.base.AbstractComponent
destroy, getWidgetByIdScript, getWidgetConfiguration, getWidgetConfigurationAsString, isAjaxified, isAjaxifiedMethods inherited from class org.primefaces.selenium.AbstractPrimePageFragment
getElementLocator, getId, getRoot, getWebDriver, getWrappedElement, setElementLocator, setWebDriverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAsMethods inherited from interface org.openqa.selenium.WebElement
click, findElement, findElements, getAccessibleName, getAriaRole, getAttribute, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, getText, isDisplayed, isSelected, sendKeys, submit
-
Constructor Details
-
AutoComplete
public AutoComplete()
-
-
Method Details
-
getInput
public org.openqa.selenium.WebElement getInput()Description copied from class:AbstractInputComponentThe input element reference.- Overrides:
getInputin classAbstractInputComponent- Returns:
- the
WebElementrepresenting the input.
-
getItems
public org.openqa.selenium.WebElement getItems() -
getItemValues
-
getPanel
public org.openqa.selenium.WebElement getPanel() -
getDropDownButton
public org.openqa.selenium.WebElement getDropDownButton() -
getValue
-
isClearAjaxified
public boolean isClearAjaxified()Is the input using AJAX "clear" event?- Returns:
- true if using AJAX for clear
-
isItemSelectAjaxified
public boolean isItemSelectAjaxified()Is the input using AJAX "itemSelect" event?- Returns:
- true if using AJAX for itemSelect
-
isItemUnselectAjaxified
public boolean isItemUnselectAjaxified()Is the input using AJAX "itemUnselect" event?- Returns:
- true if using AJAX for itemUnselect
-
isQueryAjaxified
public boolean isQueryAjaxified()Is the input using AJAX "query" event?- Returns:
- true if using AJAX for query
-
getValues
If using multiple mode gets the values of the tokens.- Returns:
- the values in a list
-
getTokens
Gets the actual token elements in mutliple mode.- Returns:
- the List of tokens
-
setValue
Sets the value and presses tab afterwards. Attention: Pressing tab selects the first suggested value.- Parameters:
value- the value to set
-
setValueWithoutTab
Sets the value without pressing tab afterwards.- Parameters:
value- the value to set- Returns:
- the delay in milliseconds
-
sendTabKey
public void sendTabKey()Sends the Tab-Key to jump to the next input. Attention: Pressing tab selects the first suggested value. -
clear
public void clear()Clears the Autocomplete input and guards AJAX for "clear" event.- Specified by:
clearin interfaceorg.openqa.selenium.WebElement- Overrides:
clearin classAbstractInputComponent
-
wait4Panel
public void wait4Panel()Waits until the AutoComplete-Panel containing the suggestions shows up. (eg after typing) -
show
public void show()Shows the AutoComplete-Panel. -
hide
public void hide()Hides the AutoComplete-Panel. -
activate
public void activate()Activates search behavior -
deactivate
public void deactivate()Deactivates search behavior -
addItem
Adds an item to the input field. Especially useful in 'multiple' mode.- Parameters:
item- the item to add to the tokens
-
removeItem
Removes an item from the input field. Especially useful in 'multiple' mode.- Parameters:
item- the item to remove from the tokens
-
search
Execute the AutoComplete search.- Parameters:
value- the search to execute
-
getDelay
public int getDelay()Delay to wait in milliseconds before sending each query to the server.- Returns:
- Delay in milliseconds.
-