Web Action Documentation
    • Dark
      Light

    Web Action Documentation

    • Dark
      Light

    Article summary

    Web actions are exposed in the Web Automation framework in Test Modeller. The corresponding Git repository is available https://github.com/CuriositySoftwareIreland/TestModeller-JavaSeleniumFramework . This uses Selenium with Java as the underlying automation technology. 

    When the framework is imported into Test Modeller, the actions below are available in the 'WebGeneralActions' module. This provides an accelerator for automating common actions on web devices. This class can be extended to incorporate your own keywords and actions as necessary.

    QuickStart Web Test Automation

    To learn how you can quickly get started with Web Automation in Test Modeller, check out our QuickStart guide: QuickStart Web Automation


    Location Strategy

    All keywords in the Test Modeller WebGeneralActions library that need to find an element on the page take a locator argument. Locator is a string that describes how to locate an element using a syntax specifying different location strategies.

    Strategy

    Example

    XPath

    xpath://input[id="username"]

    Id

    id:usernameId

    Class

    class:username

    Css

    css:#usernameId

    name

    accessibilityId:usernameObj

    linktext

    linktext:login

    text

    text:inputusername

    tagname

    tagname:button


    Web Actions

    Add Cookie (String name, String value)


    Arguments

    name - Name of the cookie 

    value - Value of the cookie

    Documentation
    Adds a cookie to your current session.

    Alert Should Be Present


    Documentation
    Verifies that an alert is present.

    Alert Assert Text (String text)


    Arguments

    text - Text to assert in the alert message.

    Documentation
    Verifies that an alert is present and contains the specified text.

    Checkbox Should Be Selected (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above. 

    Documentation
    Verifies checkbox locator is selected/checked.

    Checkbox Should Not Be Selected (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies checkbox locator is not selected/checked.

    Clear Element Text (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Clears the value of the text-input-element identified by locator.

    Assert Current Frame Contains (String text)


    Arguments

    Text - Text to assert the frame contains.

    Documentation
    Verifies that the current frame contains text.

    Assert Current Frame Does Not Contain (String text)


    Arguments

    text - Text to assert the frame does not contain.

    Documentation
    Verifies that the current frame does not contain text.

    Delete All Cookies


    Documentation
    Deletes all cookies.

    Delete Cookie (String name)


    Arguments

    name - Name of the cookie to delete.

    Documentation
    Deletes the cookie matching name.

    Drag And Drop (String fromLocator, String targetLocator)


    Arguments

    fromLocator - The object identifier to drag from. See locator strategy above.

    toLocator - The object identifier to drag to. See locator strategy above.

    Documentation
    Drags the element identified by locator into the target element.
    The locator argument is the locator of the dragged element and the target is the locator of the target.

    Drag And Drop By Offset (String objectLocator, Integer xPos, Integer yPos)


    Arguments

    objectLocator - The object identifier of the object to drag. See locator strategy above.

    xPos - X offset to perform drag.

    yPos - Y offset to perform drag

    Documentation
    Drags the element identified with locator by xoffset/yoffset.
    The element will be moved by xPos and yPos, each of which is a negative or positive number specifying the offset.

    Element Attribute Value Should Be (String objectLocator, String elementAttribute, String attributeValue)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    elementAttribute - Element attribute to retrieve value.

    elementValue - Value to check element attribute is set to.

    Documentation
    Verifies element identified by locator contains expected attribute value.

    Element Should Be Disabled (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that element identified by locator is disabled.

    Element Should Be Enabled (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that element identified by locator is enabled.

    Element Should Be Focused (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that element identified by locator is focused.

    Element Should Be Visible (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that the element identified by locator is visible.

    Element Should Contain (String objectLocator, String message)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    message - Message to check element contains

    Documentation
    Verifies that element locator contains text expected.

    Element Should Not Be Visible (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that the element identified by locator is NOT visible.

    Element Should Not Contain (String objectLocator, String message)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    message - Message to check element does not contain.

    Documentation
    Verifies that element locator does not contain text expected.

    Element Text Should Be (String objectLocator, String text)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    text - Text element should be set to.

    Documentation
    Verifies that element locator contains exact the text expected.

    Element Text Should Not Be (String objectLocator, String text)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    text - Text element should not be set to.

    Documentation
    Verifies that element locator does not contain exact the text not_expected.

    Execute Javascript (String javaScript)


    Arguments

    javaScript - Javascript code to execute.

    Documentation
    Executes the given JavaScript code with possible arguments.

    Frame Should Contain (String objectLocator, String text)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    text - Text to check frame contains.

    Documentation
    Verifies that frame identified by locator contains text.

    Get Element Attribute (String objectLocator, String attribute)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    attribute - Attribute value to return

    Documentation
    Returns the value of attribute from the element locator.

    Get Text (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Returns the text value of the element identified by locator.

    Get Title


    Documentation
    Returns the title of the current page.

    Get Value (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Returns the value attribute of the element identified by locator.

    Go Back


    Documentation
    Simulates the user clicking the back button on their browser.

    Accept Alert


    Documentation
    Accepts the alert.

    Dismiss Alert


    Documentation
    Dismisses the alert.

    Input Text Into Alert (String text)


    Arguments

    Text - Text to input into alert message.

    Documentation
    Types the given text into an input field in an alert.

    Mouse Down (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Simulates pressing the left mouse button on the element locator.

    Mouse Out (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Simulates moving the mouse away from the element locator.

    Mouse Over (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Simulates hovering the mouse over the element locator.

    Mouse Up (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Simulates releasing the left mouse button on the element locator.

    Open Context Menu (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Opens the context menu on the element identified by locator.

    Page Should Contain Text (String text)


    Arguments

    text - Text the page should contain

    Documentation
    Verifies that current page contains text.

    Page Should Contain Element (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that element locator is found on the current page.

    Page Should Not Contain Text (String text)


    Arguments

    text - Text that the page should not contain.

    Documentation
    Verifies that current page does not contain text.

    Page Should Not Contain Element (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Verifies that element locator is not found on the current page.

    Radio Button Should Be Set To (String groupName, String value)


    Arguments

    groupName - Name of the radio group

    value - Value of the selected radio button.

    Documentation
    Verifies radio button group group_name is set to value.

    Radio Button Should Not Be Selected (String groupName, String value)


    Arguments

    groupName - Name of the radio group

    value - Value of the unselected radio button.

    Documentation
    Verifies radio button group group_name has no selection.

    Reload Page


    Documentation

    Simulates user reloading page.

    Scroll Element Into View (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Scrolls the element identified by locator into view.

    Select All From List (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Selects all options from multi-selection list locator.

    Select Checkbox (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.
    Documentation

    Selects the checkbox identified by locator.
    Does nothing if checkbox is already selected.

    Select From List By Index (String objectLocator, Integer index)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    index - Index of the list item to select.

    Documentation
    Selects options from selection list locator by indexes.

    Select From List By Label (String objectLocator, String label)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    label - Label of the list item to select.

    Documentation
    Selects options from selection list locator by labels.

    Select From List By Value (String objectLocator, String value)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    value - Value of the list item to select.

    Documentation
    Selects options from selection list locator by values.

    Select Radio Button (String groupName, String value)


    Arguments

    groupName - Name of the radio button group.

    value - Value to select.

    Documentation
    Sets the radio button group group_name to value.

    Submit Form (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Submits a form identified by locator.

    Title Should Be (String value)


    Arguments

    value - Title of the page should be.

    Documentation
    Verifies that the current page title equals title.

    Unselect All From List (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Unselects all options from multi-selection list locator.

    Unselect Checkbox (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Removes the selection of checkbox identified by locator.

    Unselect From List By Index (String objectLocator, Integer index)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    index - Index of the list item to unselect.

    Documentation
    Unselects options from selection list locator by indexes.

    Unselect From List By Label (String objectLocator, String label)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    label - Label of the list item to unselect.

    Documentation
    Unselects options from selection list locator by labels.

    Unselect From List By Value (String objectLocator, String value)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    value - Value of the list item to unselect.

    Documentation
    Unselects options from selection list locator by values.

    Wait Until Element Is Enabled (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Waits until the element locator is enabled.

    Wait Until Element Is Not Visible (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Waits until the element locator is not visible.

    Wait Until Element Is Visible (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Waits until the element locator is visible.

    Wait Until Page Contains Element (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Waits until the element locator appears on the current page.

    Switch Tab


    Arguments

    tabIndex - Index of the tab to switch to.

    Documentation
    Switch tab by index. Index 0 is always the main window.

    New Window


    Documentation
    Opens a new browser window / tab.

    Open URL (String url)


    Arguments

    url - Url to open in the browser.

    Documentation
    Navigates the current browser window to the provided url.

    Click (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    Documentation
    Click the element identified by locator.

    Enter Text (String objectLocator, String text)


    Arguments

    objectLocator - The object identifier. See locator strategy above.

    text - Text to input into the object.

    Documentation

    Types the given text into the element identified by locator.

    Double Click (String objectLocator)


    Arguments

    objectLocator - The object identifier. See locator strategy above.
    Documentation

    Double clicks the element identified by locator.