|
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||
Interface contains methods emulating user actions on HTML page. For example, mouse click, text enter and so on.
| Method Summary | |
void |
back()
Emulates browser back function |
void |
chooseFile(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
Emulates result of a file choose dialog when a user clicks "Browse" button in the browser. |
void |
click(Area area,
Image image)
Emulates single mouse click on an Area element. |
void |
click(ClickableElement clickable)
Emulates single mouse click on an object. |
void |
click(org.w3c.dom.html.HTMLElement element)
Emulates single mouse click on an arbitrary HTML element. |
java.lang.Object |
executeJavaScript(java.lang.String script)
Executes specified JavaScript statements in the scope of the current page. |
java.lang.Object |
executeJavaScript(java.lang.String script,
org.w3c.dom.html.HTMLElement element)
Executes specified JavaScript statements in the scope of the current page. |
void |
forward()
Emulates browser forward function |
void |
goTo(HttpRequest request)
Sends arbitrary HTTP request. |
void |
goTo(java.lang.String URL)
Sends GET request to the specified URL. |
void |
reload()
Reloads the current page |
void |
runPageScripts()
Loads and executes all scripts associated with the current page. |
void |
selectOption(Option optionToSelect)
Emulates option selection in drop down or multiple select. |
void |
setFile(FileField field,
java.io.File fileToUpload,
java.lang.String contentType)
Deprecated. |
void |
setFileName(FileField fileField,
java.lang.String filePath)
Emulates manual enter of text into a file field. |
void |
setFileName(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
Emulates manual enter of text into a file field. |
void |
setText(PasswordField passwordField,
java.lang.String text)
Emulates text insert operation in a password field object. |
void |
setText(Textarea textarea,
java.lang.String text)
Emulates text insert operation in a textarea object. |
void |
setText(TextField textField,
java.lang.String text)
Emulates text insert operation in a text field object. |
void |
toggleOption(Option optionToToggle)
Emulates option toggling in multiple select (Ctrl + mouse click). |
| Method Detail |
public void click(ClickableElement clickable)
throws java.lang.IllegalArgumentException
clickable - - element user is able to click
java.lang.IllegalArgumentException - if clickable is null
public void click(org.w3c.dom.html.HTMLElement element)
throws java.lang.IllegalArgumentException
element - - element user is able to click
java.lang.IllegalArgumentException - if element is null
public void click(Area area,
Image image)
throws java.lang.IllegalArgumentException
click(com.actimind.actiwate.testing.html.objects.ClickableElement) and
click(org.w3c.dom.html.HTMLElement). But in case there are several images that use the same map
then the mentioned methods will generate error, so you need to use this method to specify
which image should be actually clicked.
area - - area elementimage - - image element specifying an exact image to click on.
java.lang.IllegalArgumentException
public void setText(PasswordField passwordField,
java.lang.String text)
throws java.lang.IllegalArgumentException
passwordField - - PasswordField object where user inserts texttext - - text to insert
java.lang.IllegalArgumentException - if passwordField or text is null
public void setText(TextField textField,
java.lang.String text)
throws java.lang.IllegalArgumentException
textField - - TextField object where user inserts texttext - - text to insert
java.lang.IllegalArgumentException - if textField or text is null
public void setText(Textarea textarea,
java.lang.String text)
throws java.lang.IllegalArgumentException
textarea - - textarea object where user inserts texttext - - text to insert
java.lang.IllegalArgumentException - if textarea or text is null
public void setFile(FileField field,
java.io.File fileToUpload,
java.lang.String contentType)
throws java.lang.IllegalArgumentException
field - - file upload fieldfileToUpload - - file for uploadcontentType - - content type of a file to upload (for example, "image/gif"),
if null "application/octet-stream" will be used.
java.lang.IllegalArgumentException - if field or fileToUpload is null
public void setFileName(FileField fileField,
java.lang.String filePath)
fileField - - file upload fieldfilePath - - absolute path to file for upload
java.lang.IllegalArgumentException - if fileField or filePath is null
public void setFileName(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
fileField - - file upload fieldfilePath - - absolute path to file for uploadstreamFactory - - factory to create stream containing file for uploadcontentType - - content type of a file to upload (for example, "image/gif")
java.lang.IllegalArgumentException - if fileField or streamFactory is null or filePath or contentType is null or empty stringcom.actimind.actiwate.testing.util.FileStreamFactory, ByteArrayStreamFactory
public void chooseFile(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
fileField - - file upload fieldfilePath - - absolute path to file for uploadstreamFactory - - factory to create stream containing file for uploadcontentType - - content type of a file to upload (for example, "image/gif"),
java.lang.IllegalArgumentException - if fileField or streamFactory is null or filePath or contentType is null or empty stringcom.actimind.actiwate.testing.util.FileStreamFactory, ByteArrayStreamFactory
public void selectOption(Option optionToSelect)
throws java.lang.IllegalArgumentException
optionToSelect - option to select
java.lang.IllegalArgumentException - if option is null
public void toggleOption(Option optionToToggle)
throws java.lang.IllegalArgumentException
optionToToggle - option to toggle
java.lang.IllegalArgumentException - if option is null or option from single select is passedpublic java.lang.Object executeJavaScript(java.lang.String script)
script - JavaScript code to execute.
public java.lang.Object executeJavaScript(java.lang.String script,
org.w3c.dom.html.HTMLElement element)
script - JavaScript code to execute.element - scope of script execution.
public void runPageScripts()
java.lang.IllegalStateException - if scripts were already executed on this page.
public void back()
throws HistoryExhaustedException,
PageExpiredException
HistoryExhaustedException - if there is no entries for the back operation in the history
PageExpiredException - if a previous request was a POST request
public void forward()
throws HistoryExhaustedException,
PageExpiredException
HistoryExhaustedException - if there is no entries for the forward operation in the history
PageExpiredException - if a previous request was a POST request
public void reload()
throws PageExpiredException
PageExpiredException - if the current page is a result of a POST request
public void goTo(java.lang.String URL)
throws java.lang.UnsupportedOperationException
URL - relative or absolute URL
java.lang.IllegalArgumentException - if URL is null
java.lang.UnsupportedOperationException - if this method is called for frame or iframe.
public void goTo(HttpRequest request)
throws java.lang.UnsupportedOperationException
request - request to send
java.lang.IllegalArgumentException - if request is null
java.lang.UnsupportedOperationException - if this method is called for frame or iframe.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||