|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aludratest.service.gui.web.selenium.selenium1.AbstractSeleniumAction org.aludratest.service.gui.web.selenium.selenium1.Selenium1Interaction
public class Selenium1Interaction
Provides to Web GUI interaction features.
Field Summary |
---|
Fields inherited from class org.aludratest.service.gui.web.selenium.selenium1.AbstractSeleniumAction |
---|
wrapper |
Constructor Summary | |
---|---|
Selenium1Interaction(SeleniumWrapper seleniumWrapper)
Constructor. |
Method Summary | |
---|---|
void |
addCustomHttpHeaderCommand(String key,
String value)
Tells the Selenium server to add the specified key and value as a custom outgoing request header. |
void |
assignFileResource(String elementType,
String elementName,
GUIElementLocator locator,
String filePath,
int taskCompletionTimeout)
Assigns a file resource of the test project file system to the file chooser specified by the locator. |
void |
changeCheckbox(String elementType,
String operation,
GUIElementLocator locator,
int taskCompletionTimeout)
Changes the selection state of a checkbox. |
void |
click(String elementType,
String operation,
GUIElementLocator locator,
int taskCompletionTimeout)
Clicks with a single click on any kind of element which reacts on click events. |
void |
closeOtherWindows(String elementType,
String operation,
TitleLocator locator)
Closes all open windows which do not have the specified title. |
void |
closeWindows(String elementType,
String operation,
TitleLocator locator)
Closes all windows identified by their name. |
void |
deselectCheckbox(String elementType,
String operation,
GUIElementLocator locator,
int taskCompletionTimeout)
Deselects a checkbox. |
void |
doubleClick(String elementType,
String operation,
GUIElementLocator locator,
int taskCompletionTimeout)
Does a double click on the element which is identified by the locator. |
NodeList |
evalXPath(String xpath)
Evaluates arbitrary XPath and outputs its result as NodeList object. |
NodeList |
evalXPath(XPathLocator locator)
Does the same like WebGUIInteraction.evalXPath(String) does. |
String |
evalXPathAsString(String xpath)
Evaluates arbitrary XPath and outputs its result as String. |
void |
focus(String elementType,
String operation,
GUIElementLocator locator)
Gives focus on an element. |
void |
functionalError(String msg)
|
String |
getInputFieldSelectedLabel(String elementType,
String operation,
GUIElementLocator locator)
Reads the selected label of an input field and returns it as a String without conversion/manipulation. |
String |
getInputFieldValue(String elementType,
String operation,
GUIElementLocator locator)
Reads the value of an inputfield and returns it as a String without conversion/manipulation. |
String |
getText(String elementType,
String operation,
GUIElementLocator locator)
Gets the text of an element. |
String |
getText(String elementType,
String operation,
GUIElementLocator locator,
boolean checkVisible)
Gets the text of an element and is adjustable to the check of the visibility of the element |
void |
keyPress(int keycode)
Presses a key on the keyboard. |
void |
open()
Opens the main URL of the Application Unter Test (configuration property: url.of.aut ) in a new browser window
and waits until the page is fully loaded. |
void |
refresh()
Refreshes the page of the currently selected window and waits until the page is fully loaded. |
void |
selectCheckbox(String elementType,
String operation,
GUIElementLocator locator,
int taskCompletionTimeout)
Selects a checkbox. |
void |
selectDropDownEntry(String elementType,
String operation,
GUIElementLocator locator,
OptionLocator optionLocator,
int taskCompletionTimeout)
Selects an entry in a dropdownbox with the help of a OptionLocator . |
void |
selectRadiobutton(String elementType,
String operation,
GUIElementLocator locator,
int taskCompletionTimeout)
Selects a radio button. |
void |
selectWindow(WindowLocator locator)
Selects a window using a window locator. |
void |
switchToIFrame(GUIElementLocator iframeLocator)
Switches to the given iframe element of the current web page in the current window, or switches back to default content. |
void |
type(String elementType,
String operation,
GUIElementLocator locator,
String text,
int taskCompletionTimeout)
Types in some text without conversion/manipulation of the passed through text. |
void |
waitForWindowToBeClosed(String elementType,
String elementName,
TitleLocator locator,
int taskCompletionTimeout)
Waits until the given window is closed, or the given timeout is reached. |
void |
windowFocus()
Gives focus to the currently selected window. |
void |
windowMaximize()
Maximizes the currently selected window. |
void |
wrongPageFlow(String msg)
|
Methods inherited from class org.aludratest.service.gui.web.selenium.selenium1.AbstractSeleniumAction |
---|
createAttachments, createDebugAttachments, saveSource, setSystemConnector, takeScreenShot |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.aludratest.service.Action |
---|
createAttachments, createDebugAttachments, setSystemConnector |
Constructor Detail |
---|
public Selenium1Interaction(SeleniumWrapper seleniumWrapper)
seleniumWrapper
- The SeleniumWrapper
to use.Method Detail |
---|
public void selectRadiobutton(String elementType, String operation, GUIElementLocator locator, int taskCompletionTimeout)
GUIInteraction
selectRadiobutton
in interface GUIInteraction
elementType
- the type of the related radio button to logoperation
- the name of the related radio button to loglocator
- to locate one specific radio button in the SUTpublic void changeCheckbox(String elementType, String operation, GUIElementLocator locator, int taskCompletionTimeout)
GUIInteraction
changeCheckbox
in interface GUIInteraction
elementType
- the type of the related checkbox to logoperation
- the name of the related checkbox to loglocator
- to locate one specific checkbox in the application under testpublic void selectCheckbox(String elementType, String operation, GUIElementLocator locator, int taskCompletionTimeout)
GUIInteraction
selectCheckbox
in interface GUIInteraction
elementType
- the type of the related checkbox to logoperation
- the name of the related checkbox to loglocator
- to locate one specific checkbox in the application under testpublic void deselectCheckbox(String elementType, String operation, GUIElementLocator locator, int taskCompletionTimeout)
GUIInteraction
deselectCheckbox
in interface GUIInteraction
elementType
- the type of the related checkbox to logoperation
- the name of the related checkbox to loglocator
- to locate one specific checkbox in the application under testpublic void selectDropDownEntry(String elementType, String operation, GUIElementLocator locator, OptionLocator optionLocator, int taskCompletionTimeout)
GUIInteraction
OptionLocator
. First it locates the element with the help
of the locator
, then it tries to select an entry defined by optionLocator
.
selectDropDownEntry
in interface GUIInteraction
elementType
- the type of the related dropdownbox to logoperation
- the name of the related dropdownbox to loglocator
- to locate one specific dropdownbox in the application under testoptionLocator
- defines which entry of the located dropdownbox shall be selectedpublic void type(String elementType, String operation, GUIElementLocator locator, String text, int taskCompletionTimeout)
GUIInteraction
type
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- to locate one specific inputfield in the application under test. An inputfield is any GUI element which
accepts user inputs.text
- which shall be typed in without conversion/manipulationpublic void assignFileResource(String elementType, String elementName, GUIElementLocator locator, String filePath, int taskCompletionTimeout)
GUIInteraction
assignFileResource
in interface GUIInteraction
elementType
- the type of the related GUI element to logelementName
- the name of the related GUI element to loglocator
- to locate the related file selection field in the application under testfilePath
- the absolute path of the file to be assigned to the file choosertaskCompletionTimeout
- the maximum number of milliseconds to wait for the completion of system activitiespublic void click(String elementType, String operation, GUIElementLocator locator, int taskCompletionTimeout)
GUIInteraction
click
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- to locate buttons, links or any other elements which react on mouse clicks.public String getInputFieldValue(String elementType, String operation, GUIElementLocator locator)
GUIInteraction
getInputFieldValue
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- to locate the inputfield in the application under test where the inputfield must be an element for user
inputs. Two examples are single line inputfields and text areas in web applications. This action works also with
disabled inputfields.
null
will be returnedpublic String getInputFieldSelectedLabel(String elementType, String operation, GUIElementLocator locator)
GUIInteraction
getInputFieldSelectedLabel
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- to locate the input field in the application under test where the inputfield must be an element for user
inputs. Two examples are dropdown boxes and lists in web applications. This action works also with disabled
input fields.
null
will be returnedpublic void selectWindow(WindowLocator locator)
GUIInteraction
selectWindow
in interface GUIInteraction
locator
- to locate one specific window of the application under testpublic String getText(String elementType, String operation, GUIElementLocator locator)
GUIInteraction
getText
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- points to one element
public String getText(String elementType, String operation, GUIElementLocator locator, boolean checkVisible)
GUIInteraction
getText
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- points to one element, visible: to check visibility of the element
public void open()
WebGUIInteraction
url.of.aut
) in a new browser window
and waits until the page is fully loaded. This method has to be called before most methods of the check()
,
perform()
and verify()
objects can be used.
open
in interface WebGUIInteraction
public void refresh()
WebGUIInteraction
refresh
in interface WebGUIInteraction
public void windowMaximize()
WebGUIInteraction
windowMaximize
in interface WebGUIInteraction
public void windowFocus()
WebGUIInteraction
windowFocus
in interface WebGUIInteraction
public void switchToIFrame(GUIElementLocator iframeLocator)
WebGUIInteraction
switchToIFrame
in interface WebGUIInteraction
iframeLocator
- Locator which uniquely identifies the inner frame to switch to. Use null
to switch back
to default content.public void focus(String elementType, String operation, GUIElementLocator locator)
GUIInteraction
focus
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- of the element which shall get the focuspublic void keyPress(int keycode)
GUIInteraction
KeyEvent
.
keyPress
in interface GUIInteraction
keycode
- is the key which shall be pressed.KeyEvent
public void doubleClick(String elementType, String operation, GUIElementLocator locator, int taskCompletionTimeout)
GUIInteraction
doubleClick
in interface GUIInteraction
elementType
- the type of the related GUI element to logoperation
- the name of the related GUI element to loglocator
- which identifies the element which shall be double clickedpublic void closeOtherWindows(String elementType, String operation, TitleLocator locator)
GUIInteraction
closeOtherWindows
in interface GUIInteraction
elementType
- the type of the target windows to logoperation
- the name of the target windows to loglocator
- is a window locator or just a String which will be automatically converted to one of the default locators
depending on the underlying driver and the used default localization mechanismpublic void closeWindows(String elementType, String operation, TitleLocator locator)
GUIInteraction
closeWindows
in interface GUIInteraction
elementType
- the type of the target windows to logoperation
- the name of the target windows to loglocator
- - name of the windowpublic void waitForWindowToBeClosed(String elementType, String elementName, TitleLocator locator, int taskCompletionTimeout)
GUIInteraction
waitForWindowToBeClosed
in interface GUIInteraction
elementType
- the type of the target windows to logelementName
- the name of the target windows to loglocator
- is a window locator or just a String which will be automatically converted to one of the default locators
depending on the underlying driver and the used default localization mechanismtaskCompletionTimeout
- Timeout to wait until the window is closed. If the timeout is triggered, a TimeoutException is
raised. A value of -1 indicates to use the default configured timeout.public void addCustomHttpHeaderCommand(String key, String value)
WebGUIInteraction
addCustomHttpHeaderCommand
in interface WebGUIInteraction
key
- the header namevalue
- the header valuepublic void wrongPageFlow(String msg)
wrongPageFlow
in interface GUIInteraction
public void functionalError(String msg)
functionalError
in interface GUIInteraction
public NodeList evalXPath(XPathLocator locator)
WebGUIInteraction
WebGUIInteraction.evalXPath(String)
does.
evalXPath
in interface WebGUIInteraction
locator
- whose XPath expression will be taken and evaluated
public NodeList evalXPath(String xpath)
WebGUIInteraction
evalXPath
in interface WebGUIInteraction
xpath
- XPath expression to be executed
public String evalXPathAsString(String xpath)
WebGUIInteraction
evalXPathAsString
in interface WebGUIInteraction
xpath
- XPath expression to be executed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |