Class FileUpload
- java.lang.Object
-
- org.primefaces.selenium.AbstractPrimePageFragment
-
- org.primefaces.selenium.component.base.AbstractComponent
-
- org.primefaces.selenium.component.base.AbstractInputComponent
-
- org.primefaces.selenium.component.FileUpload
-
- All Implemented Interfaces:
org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
public abstract class FileUpload extends AbstractInputComponent
Component wrapper for the PrimeFacesp:fileUpload.
-
-
Constructor Summary
Constructors Constructor Description FileUpload()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.WebElementgetAdvancedCancelButton()Gets the Cancel button of the widget.org.openqa.selenium.WebElementgetAdvancedCancelButton(String fileName)Gets the file Cancel button of the widget.org.openqa.selenium.WebElementgetAdvancedUploadButton()Gets the Upload button of the widget.org.openqa.selenium.WebElementgetInput()The input element reference.StringgetValue()Returns the input´s value.List<String>getWidgetErrorMessages()Gets the values displayed by the widget.StringgetWidgetValue()Gets the value displayed by the widget.List<String>getWidgetValues()Gets the values displayed by the widget.voidsetValue(File... values)Sets the input's value from given files.voidsetValue(Serializable value)Sets the input's value.voidwaitAdvancedUntilAllFilesAreUploaded(org.openqa.selenium.WebElement additionalElementToWaitFor)Waits until all selected files are uploaded.-
Methods inherited from class org.primefaces.selenium.component.base.AbstractInputComponent
clear, copyToClipboard, disable, enable, getAssignedLabel, getAssignedLabelText, isEnabled, isOnchangeAjaxified, pasteFromClipboard, selectAllText
-
Methods inherited from class org.primefaces.selenium.component.base.AbstractComponent
getWidgetByIdScript, getWidgetConfiguration, getWidgetConfigurationAsString, isAjaxified, isAjaxified
-
Methods inherited from class org.primefaces.selenium.AbstractPrimePageFragment
getElementLocator, getId, getRoot, getWebDriver, getWrappedElement, setElementLocator, setWebDriver
-
-
-
-
Method Detail
-
getInput
public org.openqa.selenium.WebElement getInput()
Description copied from class:AbstractInputComponentThe input element reference.- Overrides:
getInputin classAbstractInputComponent- Returns:
- the
WebElementrepresenting the input.
-
getValue
public String getValue()
Returns the input´s value.- Returns:
- the file name
-
setValue
public void setValue(Serializable value)
Sets the input's value. This should be the files absolute path.- Parameters:
value- the file name to set
-
setValue
public void setValue(File... values)
Sets the input's value from given files.- Parameters:
values- the file name(s) to set
-
getAdvancedUploadButton
public org.openqa.selenium.WebElement getAdvancedUploadButton()
Gets the Upload button of the widget. The button is only rendered in advanced mode.- Returns:
- the widget's upload button
-
getAdvancedCancelButton
public org.openqa.selenium.WebElement getAdvancedCancelButton()
Gets the Cancel button of the widget. The button is only rendered in advanced mode.- Returns:
- the widget's cancel button
-
getAdvancedCancelButton
public org.openqa.selenium.WebElement getAdvancedCancelButton(String fileName)
Gets the file Cancel button of the widget. The button is only rendered in advanced mode.- Parameters:
fileName- the file name for which to return the cancel button- Returns:
- the widget's cancel button
-
waitAdvancedUntilAllFilesAreUploaded
public void waitAdvancedUntilAllFilesAreUploaded(org.openqa.selenium.WebElement additionalElementToWaitFor)
Waits until all selected files are uploaded. This only works in advanced mode.- Parameters:
additionalElementToWaitFor- element to wait for stable GUI
-
getWidgetValue
public String getWidgetValue()
Gets the value displayed by the widget.- Returns:
- the widget's value
-
getWidgetValues
public List<String> getWidgetValues()
Gets the values displayed by the widget.- Returns:
- the widget's values
-
-