org.aludratest.service.gui
Interface GUIInteraction

All Superinterfaces:
Action, Interaction
All Known Subinterfaces:
WebGUIInteraction
All Known Implementing Classes:
Selenium1Interaction, Selenium2Interaction

public interface GUIInteraction
extends Interaction

The interface Interaction provides several methods to interact with the active screen of the application under test. This means that the application under test can be controlled with the help of these methods. Every class which implements this interface must assure that a call of one of these methods results in a interaction with the application under test.
For verifications of the application under test see Verification.

Author:
Marcel Malitz, Volker Bergmann

Method Summary
 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 elementName, GUIElementLocator locator, int taskCompletionTimeout)
          Changes the selection state of a checkbox.
 void click(String elementType, String elementName, GUIElementLocator locator, int taskCompletionTimeout)
          Clicks with a single click on any kind of element which reacts on click events.
 void closeOtherWindows(String elementType, String elementName, TitleLocator locator)
          Closes all open windows which do not have the specified title.
 void closeWindows(String elementType, String elementName, TitleLocator locator)
          Closes all windows identified by their name.
 void deselectCheckbox(String elementType, String elementName, GUIElementLocator locator, int taskCompletionTimeout)
          Deselects a checkbox.
 void doubleClick(String elementType, String elementName, GUIElementLocator locator, int taskCompletionTimeout)
          Does a double click on the element which is identified by the locator.
 void focus(String elementType, String elementName, GUIElementLocator locator)
          Gives focus on an element.
 void functionalError(String message)
           
 String getInputFieldSelectedLabel(String elementType, String elementName, GUIElementLocator locator)
          Reads the selected label of an input field and returns it as a String without conversion/manipulation.
 String getInputFieldValue(String elementType, String elementName, GUIElementLocator locator)
          Reads the value of an inputfield and returns it as a String without conversion/manipulation.
 String getText(String elementType, String elementName, GUIElementLocator locator)
          Gets the text of an element.
 String getText(String elementType, String elementName, 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 selectCheckbox(String elementType, String elementName, GUIElementLocator locator, int taskCompletionTimeout)
          Selects a checkbox.
 void selectDropDownEntry(String elementType, String elementName, GUIElementLocator locator, OptionLocator optionLocator, int taskCompletionTimeout)
          Selects an entry in a dropdownbox with the help of a OptionLocator.
 void selectRadiobutton(String elementType, String elementName, GUIElementLocator locator, int taskCompletionTimeout)
          Selects a radio button.
 void selectWindow(WindowLocator locator)
          Selects a window using a window locator.
 void type(String elementType, String elementName, 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 wrongPageFlow(String message)
           
 
Methods inherited from interface org.aludratest.service.Action
createAttachments, createDebugAttachments, setSystemConnector
 

Method Detail

selectRadiobutton

void selectRadiobutton(String elementType,
                       String elementName,
                       GUIElementLocator locator,
                       int taskCompletionTimeout)
Selects a radio button. If this radio button belongs to a group of radio buttons, the other radio buttons of this group will be unselected.

Parameters:
elementType - the type of the related radio button to log
elementName - the name of the related radio button to log
locator - to locate one specific radio button in the SUT
taskCompletionTimeout -

changeCheckbox

void changeCheckbox(String elementType,
                    String elementName,
                    GUIElementLocator locator,
                    int taskCompletionTimeout)
Changes the selection state of a checkbox. If this method will be called on a checkbox which is still selected, the checkbox will be unselected.

Parameters:
elementType - the type of the related checkbox to log
elementName - the name of the related checkbox to log
locator - to locate one specific checkbox in the application under test
taskCompletionTimeout -

selectCheckbox

void selectCheckbox(String elementType,
                    String elementName,
                    GUIElementLocator locator,
                    int taskCompletionTimeout)
Selects a checkbox. If the checkbox is already selected, this method will do nothing.

Parameters:
elementType - the type of the related checkbox to log
elementName - the name of the related checkbox to log
locator - to locate one specific checkbox in the application under test
taskCompletionTimeout -

deselectCheckbox

void deselectCheckbox(String elementType,
                      String elementName,
                      GUIElementLocator locator,
                      int taskCompletionTimeout)
Deselects a checkbox. If the checkbox is not selected, this method will do nothing.

Parameters:
elementType - the type of the related checkbox to log
elementName - the name of the related checkbox to log
locator - to locate one specific checkbox in the application under test
taskCompletionTimeout -

selectDropDownEntry

void selectDropDownEntry(String elementType,
                         String elementName,
                         GUIElementLocator locator,
                         OptionLocator optionLocator,
                         int taskCompletionTimeout)
Selects an entry in a dropdownbox with the help of a OptionLocator. First it locates the element with the help of the locator, then it tries to select an entry defined by optionLocator.

Parameters:
elementType - the type of the related dropdownbox to log
elementName - the name of the related dropdownbox to log
locator - to locate one specific dropdownbox in the application under test
optionLocator - defines which entry of the located dropdownbox shall be selected
taskCompletionTimeout -

type

void type(String elementType,
          String elementName,
          GUIElementLocator locator,
          String text,
          int taskCompletionTimeout)
Types in some text without conversion/manipulation of the passed through text. The content of the locator will be deleted, if the expected text is not set.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - 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/manipulation
taskCompletionTimeout -

assignFileResource

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.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - to locate the related file selection field in the application under test
filePath - the absolute path of the file to be assigned to the file chooser
taskCompletionTimeout - the maximum number of milliseconds to wait for the completion of system activities

click

void click(String elementType,
           String elementName,
           GUIElementLocator locator,
           int taskCompletionTimeout)
Clicks with a single click on any kind of element which reacts on click events. A common example are buttons and links.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - to locate buttons, links or any other elements which react on mouse clicks.
taskCompletionTimeout -

doubleClick

void doubleClick(String elementType,
                 String elementName,
                 GUIElementLocator locator,
                 int taskCompletionTimeout)
Does a double click on the element which is identified by the locator.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - which identifies the element which shall be double clicked
taskCompletionTimeout -

getInputFieldValue

String getInputFieldValue(String elementType,
                          String elementName,
                          GUIElementLocator locator)
Reads the value of an inputfield and returns it as a String without conversion/manipulation.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - 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.
Returns:
the value of the inputfield. If the inputfield could not be found, null will be returned

getInputFieldSelectedLabel

String getInputFieldSelectedLabel(String elementType,
                                  String elementName,
                                  GUIElementLocator locator)
Reads the selected label of an input field and returns it as a String without conversion/manipulation.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - 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.
Returns:
the value of the input field. If the input field could not be found, null will be returned

selectWindow

void selectWindow(WindowLocator locator)
Selects a window using a window locator. Once a window has been selected, all commands go to that window.

Parameters:
locator - to locate one specific window of the application under test

getText

String getText(String elementType,
               String elementName,
               GUIElementLocator locator)
Gets the text of an element.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - points to one element
Returns:
the unmodified text of an element

getText

String getText(String elementType,
               String elementName,
               GUIElementLocator locator,
               boolean checkVisible)
Gets the text of an element and is adjustable to the check of the visibility of the element

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - points to one element, visible: to check visibility of the element
checkVisible -
Returns:
the unmodified text of an element

focus

void focus(String elementType,
           String elementName,
           GUIElementLocator locator)
Gives focus on an element.

Parameters:
elementType - the type of the related GUI element to log
elementName - the name of the related GUI element to log
locator - of the element which shall get the focus

keyPress

void keyPress(int keycode)
Presses a key on the keyboard. Available key codes can be found in KeyEvent.

Parameters:
keycode - is the key which shall be pressed.
See Also:
KeyEvent

closeWindows

void closeWindows(String elementType,
                  String elementName,
                  TitleLocator locator)
Closes all windows identified by their name. That means, that if there are several windows with same name all will be closed. This method is not waiting for a window to open.

Parameters:
elementType - the type of the target windows to log
elementName - the name of the target windows to log
locator - - name of the window

closeOtherWindows

void closeOtherWindows(String elementType,
                       String elementName,
                       TitleLocator locator)
Closes all open windows which do not have the specified title.

Parameters:
elementType - the type of the target windows to log
elementName - the name of the target windows to log
locator - 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 mechanism

waitForWindowToBeClosed

void waitForWindowToBeClosed(String elementType,
                             String elementName,
                             TitleLocator locator,
                             int taskCompletionTimeout)
Waits until the given window is closed, or the given timeout is reached. This is especially useful if a window is closed asynchronously some time after some event (e.g. a button click).

Parameters:
elementType - the type of the target windows to log
elementName - the name of the target windows to log
locator - 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 mechanism
taskCompletionTimeout - 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.

wrongPageFlow

void wrongPageFlow(String message)

functionalError

void functionalError(String message)


Copyright © 2015 aludratest.org. All rights reserved.