version 1.0

com.actimind.actiwate.testing.html
Interface PageObjectLookup

All Known Subinterfaces:
ActiwateSession, Frame, IFrame, Page, Window
All Known Implementing Classes:
ActiwateTestCase

public interface PageObjectLookup

Contains methods for HTML objects lookup.


Method Summary
 Button button(int index)
          Returns button within this page by specified index.
 Button button(java.lang.String nameOrId)
          Searches for a button with specified name or id.
 Button button(java.lang.String nameOrId, int index)
          Searches for a buttons with specified name/id and returns button having specified index.
 Button buttonByText(java.lang.String buttonCaption)
          The search is done by visible button caption text: this means that for <button> tags this is a text within button and for all other types of button this is a text within button value.
 Checkbox checkbox(java.lang.String nameOrId)
          Searches for checkbox with specified name or id attribute
 Checkbox checkbox(java.lang.String nameOrId, java.lang.String value)
          Searches for checkbox with specified name/id and value
 Checkbox[] checkboxes(java.lang.String nameOrId)
          Searches for checkboxes with specified nameOrId or id attribute
 FileField fileField(java.lang.String nameOrId)
          Searches for a file field with specified name or id.
 FileField fileField(java.lang.String nameOrId, int index)
          Searches for a file fields with specified name or id and returns field with specified order index.
 FileField[] fileFields(java.lang.String nameOrId)
          Returns all file fields with specified name or id.
 Image image(java.lang.String nameOrId)
          Searches for image or image button by name or id attribute value.
 Image imageByAlt(java.lang.String altText)
          Searches for image or image button by alt attribute value.
 Image imageByURL(java.lang.String url)
          Searches for image or image button by specified url.
 ImageMap imageMap(int idx)
          Returns map by index on a page.
 ImageMap imageMap(java.lang.String nameOrId)
          Searches for map by name or id attribute value.
 ImageMap[] imageMaps()
          Returns all HTML maps found on a page.
 Image[] images()
          Returns all images and image buttons.
 Link link(int index)
          Returns link contained in this page by its index.
 Link linkById(java.lang.String id)
          Searches for link by specified id attribute.
 Link linkByText(java.lang.String linkText)
          Searches for link having specified text.
 Link linkByTitle(java.lang.String title)
          Searches for link by title attribute value.
 Link[] links()
          Returns all links.
 MultipleSelect multiSelect(java.lang.String nameOrId)
          Searches for HTML multiple select with specified name or id attribute.
 PasswordField passwordField(java.lang.String nameOrId)
          Searches for a password field with specified name or id.
 RadioButton radioButton(java.lang.String groupNameOrId, int index)
          Searches for group of radio buttons with specified name or id and returns radio button with specified index.
 RadioButton radioButton(java.lang.String groupNameOrId, java.lang.String value)
          Searches for radio button with specified name/id and value.
 RadioButton[] radioButtons(java.lang.String groupNameOrId)
          Searches for group of radio buttons with specified name or id attribute
 SingleSelect singleSelect(java.lang.String nameOrId)
          Searches for HTML single select (drop down) with specified name or id attribute.
 Table table(int index)
          Returns table by index on a page.
 Table tableById(java.lang.String id)
          Searches for table having specified value in id attribute.
 Table tableByText(java.lang.String textInCell)
          Returns table having containing specified text in one of it's cells.
 Textarea textarea(java.lang.String nameOrId)
          Searches for a textarea with specified name or id.
 TextField textField(java.lang.String nameOrId)
          Searches for a text field with specified name or id.
 TextField textField(java.lang.String nameOrId, int index)
          Searches for a text fields with specified name or id and returns field with specified index.
 TextField[] textFields(java.lang.String nameOrId)
          Returns all text fields with specified name or id.
 

Method Detail

textField

public TextField textField(java.lang.String nameOrId)
                    throws LookupException
Searches for a text field with specified name or id.

Parameters:
nameOrId - name or id of a text field
Returns:
TextField object for the first found text field
Throws:
LookupException - if text field was not found

textField

public TextField textField(java.lang.String nameOrId,
                           int index)
                    throws LookupException
Searches for a text fields with specified name or id and returns field with specified index. Where index calculated among other fields in document order, starting from zero.

Parameters:
nameOrId - name or id of a text field
index - index of a field with specified name or id to return, starts from zero
Returns:
TextField object for the found text field
Throws:
LookupException - if text field was not found

textFields

public TextField[] textFields(java.lang.String nameOrId)
                       throws LookupException
Returns all text fields with specified name or id.

Parameters:
nameOrId - name or id of a text field
Returns:
Array of TextField objects
Throws:
LookupException - if there are no text fields with specified name or id

passwordField

public PasswordField passwordField(java.lang.String nameOrId)
                            throws LookupException
Searches for a password field with specified name or id.

Parameters:
nameOrId - name or id of a password field
Returns:
PasswordField object for the first found password field
Throws:
LookupException - if password field was not found

textarea

public Textarea textarea(java.lang.String nameOrId)
                  throws LookupException
Searches for a textarea with specified name or id.

Parameters:
nameOrId - name or id of a textarea
Returns:
Textarea object for the first found textarea
Throws:
LookupException - if textarea was not found

fileField

public FileField fileField(java.lang.String nameOrId)
                    throws LookupException
Searches for a file field with specified name or id.

Parameters:
nameOrId - name or id of a file field
Returns:
FileField object for the first found file field
Throws:
LookupException - if file field was not found

fileField

public FileField fileField(java.lang.String nameOrId,
                           int index)
                    throws LookupException
Searches for a file fields with specified name or id and returns field with specified order index. Index is a index of this field in document order, starting from zero.

Parameters:
nameOrId - name or id of a field
index - index of a field with specified name or id to return, starts from zero
Returns:
FileField object for the found field
Throws:
LookupException - if file field was not found

fileFields

public FileField[] fileFields(java.lang.String nameOrId)
                       throws LookupException
Returns all file fields with specified name or id.

Parameters:
nameOrId - name or id of a file field
Returns:
Array of FileField objects
Throws:
LookupException - if there are no file fields with specified name or id

link

public Link link(int index)
          throws LookupException
Returns link contained in this page by its index.

Parameters:
index - index of link on the page, starting from zero
Returns:
link in this page by its index.
Throws:
LookupException - if link was not found.

linkByText

public Link linkByText(java.lang.String linkText)
                throws LookupException
Searches for link having specified text. Text within link will be normalized before comparing.

Parameters:
linkText - text link should contain
Returns:
Link object for the first found link
Throws:
LookupException - if link was not found

linkById

public Link linkById(java.lang.String id)
              throws LookupException
Searches for link by specified id attribute.

Parameters:
id - value of id attribute
Returns:
Link object for the first found link
Throws:
LookupException - if link was not found

linkByTitle

public Link linkByTitle(java.lang.String title)
                 throws LookupException
Searches for link by title attribute value. Attribute value will be normalized before comparing.

Parameters:
title - value of title attribute
Returns:
Link object for the first found link
Throws:
LookupException - if link was not found

links

public Link[] links()
Returns all links.

Returns:
all links or empty array if there are no links.

button

public Button button(int index)
              throws LookupException
Returns button within this page by specified index.

Parameters:
index - index of a button among other buttons
Returns:
Button object for the found button
Throws:
LookupException - if button was not found

button

public Button button(java.lang.String nameOrId)
              throws LookupException
Searches for a button with specified name or id.

Parameters:
nameOrId - name or id of a button
Returns:
Button object for the first found button
Throws:
LookupException - if button was not found

button

public Button button(java.lang.String nameOrId,
                     int index)
              throws LookupException
Searches for a buttons with specified name/id and returns button having specified index.

Parameters:
nameOrId - name or id of a button
index - index of a button among other buttons with same name/id
Returns:
Button object for the found button
Throws:
LookupException - if button was not found

buttonByText

public Button buttonByText(java.lang.String buttonCaption)
                    throws LookupException
The search is done by visible button caption text: this means that for <button> tags this is a text within button and for all other types of button this is a text within button value.

Parameters:
buttonCaption - visible caption of a button
Returns:
Button object for the first found button
Throws:
LookupException - if button was not found

checkbox

public Checkbox checkbox(java.lang.String nameOrId)
                  throws LookupException
Searches for checkbox with specified name or id attribute

Parameters:
nameOrId - name or id attribute value
Returns:
Checkbox object for the first found checkbox
Throws:
LookupException - if checkbox was not found

checkboxes

public Checkbox[] checkboxes(java.lang.String nameOrId)
Searches for checkboxes with specified nameOrId or id attribute

Parameters:
nameOrId - name or id attribute value
Returns:
Array of Checkbox objects
Throws:
LookupException - if there are no checkboxes with specified name or id

checkbox

public Checkbox checkbox(java.lang.String nameOrId,
                         java.lang.String value)
Searches for checkbox with specified name/id and value

Parameters:
nameOrId - name or id of checkbox
value - value of checkbox
Returns:
Checkbox object for the found checkbox
Throws:
LookupException - if checkbox was not found

radioButton

public RadioButton radioButton(java.lang.String groupNameOrId,
                               int index)
                        throws LookupException
Searches for group of radio buttons with specified name or id and returns radio button with specified index. Where index is a number of radio button in a group of radio buttons in document order, starting from zero.

Parameters:
groupNameOrId - name or id attribute value
index - index of a radio button with specified name or id to return, starts from zero
Returns:
RadioButton object for the found radio button
Throws:
LookupException - if radio button was not found

radioButton

public RadioButton radioButton(java.lang.String groupNameOrId,
                               java.lang.String value)
                        throws LookupException
Searches for radio button with specified name/id and value.

Parameters:
groupNameOrId - name or id of radio button
value - value of radio button in the group
Returns:
RadioButton object for the found radio button
Throws:
LookupException - if radio button was not found

radioButtons

public RadioButton[] radioButtons(java.lang.String groupNameOrId)
                           throws LookupException
Searches for group of radio buttons with specified name or id attribute

Parameters:
groupNameOrId - name or id attribute value
Returns:
Array of RadioButton objects
Throws:
LookupException - if there are no radio buttons with specified name or id

singleSelect

public SingleSelect singleSelect(java.lang.String nameOrId)
                          throws LookupException
Searches for HTML single select (drop down) with specified name or id attribute.

Parameters:
nameOrId - name or id attribute value
Returns:
SingleSelect object for the first found drop down
Throws:
LookupException - if drop down was not found

multiSelect

public MultipleSelect multiSelect(java.lang.String nameOrId)
                           throws LookupException
Searches for HTML multiple select with specified name or id attribute.

Parameters:
nameOrId - name or id attribute value
Returns:
MultipleSelect object for the first found multiple select
Throws:
LookupException - if multiple select was not found

table

public Table table(int index)
            throws LookupException
Returns table by index on a page. Search does not take into account tables nested in other tables.

Parameters:
index - index of table among other not nested tables on a page, starting from zero.
Returns:
table Table object for the found table.
Throws:
LookupException - if table was not found

tableByText

public Table tableByText(java.lang.String textInCell)
                  throws LookupException
Returns table having containing specified text in one of it's cells. Text in the cell will be normalized before comparing.

Parameters:
textInCell - text expected to be in the table cell
Returns:
table containing specified text in one of it's cells.
Throws:
LookupException - if table was not found

tableById

public Table tableById(java.lang.String id)
                throws LookupException
Searches for table having specified value in id attribute.

Parameters:
id - value of id attribute
Returns:
Table having specified value in id attribute.
Throws:
LookupException - if table was not found

image

public Image image(java.lang.String nameOrId)
            throws LookupException
Searches for image or image button by name or id attribute value.

Parameters:
nameOrId - name or id attribute value
Returns:
Image object for the first found image or image button
Throws:
LookupException - if image was not found

imageByAlt

public Image imageByAlt(java.lang.String altText)
                 throws LookupException
Searches for image or image button by alt attribute value. Attribute value will be normalized before comparing.

Parameters:
altText - text within alt attribute
Returns:
Image object for the first found image or image button
Throws:
LookupException - if image was not found

imageByURL

public Image imageByURL(java.lang.String url)
                 throws LookupException,
                        java.lang.IllegalArgumentException
Searches for image or image button by specified url. Argument url can be absolute or relative. If url is relative absolute url will be constructed from the base URL of the test.

Image location will be calculated from location of the current page and value specified in src attribute (if src contains servlet session id - it will be ignored).

Parameters:
url - absolute or relative url of searched image
Returns:
first image or image button having specified location
Throws:
LookupException - if image was not found
java.lang.IllegalArgumentException - if url is null, or url is relative and current base URL is null.

images

public Image[] images()
Returns all images and image buttons.

Returns:
all images and image buttons or empty array if images were not found.

imageMap

public ImageMap imageMap(java.lang.String nameOrId)
                  throws LookupException
Searches for map by name or id attribute value.

Parameters:
nameOrId - name or id attribute value
Returns:
ImageMap object for the first map found
Throws:
LookupException - if map was not found

imageMap

public ImageMap imageMap(int idx)
                  throws LookupException
Returns map by index on a page.

Parameters:
idx - index of map among other maps on a page, starting from zero.
Returns:
ImageMap object for the found table.
Throws:
LookupException - if map was not found

imageMaps

public ImageMap[] imageMaps()
Returns all HTML maps found on a page. If no maps found then empty array is returned

Returns:
an array of maps found on a page


Copyright © 2007 Actimind, Inc. All Rights Reserved.