Package org.kquiet.browser.action
Class Upload
java.lang.Object
org.kquiet.browser.action.MultiPhaseAction
org.kquiet.browser.action.Upload
- All Implemented Interfaces:
Composable,MultiPhased
Upload is a subclass of MultiPhaseAction which types path of file into the file
upload element. StaleElementReferenceException may happen while
Select tries to manipulate the element, so multi-phase is used to perform the action
again.
Upload needs to make the file upload element visible first, so below javascript will
be executed before typing into it:
fileUploadElement.style.display = 'inline-block'; fileUploadElement.style.visibility = 'visible'; fileUploadElement.style.height = '1px'; fileUploadElement.style.width = '1px'; fileUploadElement.style.opacity = 1;
- Author:
- Kimberly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerform multiple-phased browser action.toString()Methods inherited from class org.kquiet.browser.action.MultiPhaseAction
getActionState, getComposer, getCostTime, getErrors, hasNextPhase, isDone, isFail, noNextPhase, perform, setActionState, setComposer, switchToTopForFirefox
-
Constructor Details
-
Upload
Create an action to perform file uploads.- Parameters:
by- the element locating mechanismpathOfFiles- the paths of files to upload
-
Upload
public Upload(org.openqa.selenium.By by, List<org.openqa.selenium.By> frameBySequence, String... pathOfFiles) Create an action to perform file uploads.- Parameters:
by- the element locating mechanismframeBySequence- the sequence of the frame locating mechanism for the element resides in frame(or frame in another frame and so on)pathOfFiles- the paths of files to upload
-
-
Method Details
-
performMultiPhase
protected void performMultiPhase()Description copied from class:MultiPhaseActionPerform multiple-phased browser action.MultiPhaseAction.noNextPhase()needs to be invoked to signal that there is no more phase to execute.- Specified by:
performMultiPhasein classMultiPhaseAction
-
toString
- Overrides:
toStringin classMultiPhaseAction
-