Desktop Action Documentation

Desktop actions are exposed in the Desktop Automation framework in Quality Modeller. The corresponding Git repository is available https://github.com/CuriositySoftwareIreland/TestModeller-FlaUI. This uses FlaUI with C# as the underlying automation technology. 

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

QuickStart Desktop Test Automation

To learn how you can quickly get started with Desktop Automation in Quality Modeller: QuickStart Desktop Automation


Location Strategy

All keywords in the Quality Modeller DesktopGeneralActions library that need to find an element on the page take a locator argument. Locator is a string that specifies the element identifier to use for finding the element. We recommend you use FlaUIInspect to find the associated ID for an element, https://github.com/FlaUI/FlaUInspect.

Strategy

Example

XPath

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

Id

id:usernameId

Class

class:username

Text

text:#usernameId

Value

value:user

Help Text

helpText:usernameObj

Automation ID (Default)

usernameObjID


Library Usage

In order to use the library actions, you need to firstly open an application on the Windows desktop. To do this, you can use the command 'Open Application' with the parameter of the location of the application. e.g.

OpenApplication("c:\calc.exe")

Desktop Actions

Open Store Application (String appName)


Arguments

appName - Application name from store

Documentation

Launches an application from the Store.

Open Application (String appName)


Arguments

appName -  Relative or absolute path to executable to launch

Documentation

Launches an application.

Use Main Window


Documentation
Use main window

Enter Text (String objectName, String text)


Arguments

objectName - Object identifier
text - Value to set to textbox

Documentation
Inputs value to a textbox module.

AssertLabelText(String objectName, String text)


Arguments

objectName - Object identifier

text - Text to assert label

Documentation

Close Application


Documentation
Closes the attached application.

Click (String objectName)


Arguments

objectName - Object identifier

Documentation
Click to element.

Right Click (String objectName)


Arguments

objectName - Object identifier

Documentation
Right click to element.

Double Click (String objectName)


Arguments

objectName - Object identifier

Documentation
Double click to element.

Select Combobox Item By Index (String objectName, int index)


Arguments

objectName - Object identifier

index - Index of the combobox item to select

Documentation
Selects item from combobox with given index number. Combobox will be automatic collapsed after selection is done.

Select Listbox Item By Index (String objectName, int index)


Arguments

objectName - Object identifier

index - Index of the list box item to select

Documentation
Selects item from listbox with given index number

Select Radiobutton (String objectName)


Arguments

objectName - Object identifier

Documentation
Select given radiobutton by xpath.

Close Window


Documentation

Close the current window open

Collapse All Treeitems (String objectName)


Arguments

objectName - Object identifier

Documentation
Collapse every collapsable tree items of the given tree.

Collapse Combobox (String objectName)


Arguments

objectName - Object identifier

Documentation
Collapse combobox.

Combobox Should Contain (String objectName, String itemName)


Arguments

objectName - Object identifier

itemName - Name the combobox should contain

Documentation
Checks if Combobox contains an item

Drag And Drop (String fromObject, String endObject)


Arguments

objectName - Object to drag from

endObject - Object to drag onto

Documentation
Clicks and hold the item with start_identifier and drops it at item with end_identifier.

Element Should Be Visible (String objectName)


Arguments

objectName - Object identifier

Documentation
Checks if element is visible. If element is visible True will be returned otherwise False.

Element Should Exist (String objectName)


Arguments

objectName - Object identifier

Documentation
Checks if element exists. If element exists True will be returned otherwise False.

Element Should Not Be Visible (String objectName)


Arguments

objectName - Object identifier

Documentation
Checks if element is visible.

Element Should Not Exist (String objectName)


Arguments

objectName - Object identifier

Documentation
Checks if element exists. If element exists False will be returned otherwise True.

Expand All Treeitems (String objectName)


Arguments

objectName - Object identifier

Documentation
Expands every expandable Tree Items items of the given tree.

Expand Combobox (String objectName)


Arguments

objectName - Object identifier

Documentation
Expand combobox.

Expand Treeitem (String objectName)


Arguments

objectName - Object identifier

Documentation
Expands item from tree by hybrid pointers, series of indexes and names.

Focus (String objectName)


Arguments

objectName - Object identifier

Documentation
Try to focus element.

Get Checkbox State (String objectName)


Arguments

objectName - Object identifier

Documentation
Return actual checked state from checkbox.

Get Combobox Items Count (String objectName)


Arguments

objectName - Object identifier

Documentation
Return actual count of items in combobox.

Get Grid Rows Count (String objectName)


Arguments

objectName - Object identifier

Documentation
Return count of rows from data grid.

Get Listbox Items Count (String objectName)


Arguments

objectName - Object identifier

Documentation
Return count of rows in listbox.

Get Name From Element (String objectName)


Arguments

objectName - Object identifier

Documentation
Return name value from element.

Get Radiobutton State (String objectName)


Arguments

objectName - Object identifier

Documentation
Return actual state from radiobutton.

Get Root Treeitems Count (String objectName)


Arguments

objectName - Object identifier

Documentation
Return count of items in the first level of the tree.

Get Text From Textbox (String objectName)


Arguments

objectName - Object identifier

Documentation
Return text from textbox element.

Verify Element Enabled (String objectName)


Arguments

objectName - Object identifier

Documentation
Verifies if element is enabled (true) or not (false).

Listbox Selection Should Be (String objectName, String name)


Arguments

objectName - Object identifier

name - Name of the selected listbox item should be

Documentation
Checks if the selected listbox items are same with the given ones.

Listbox Should Contain (String objectName, String name)


Arguments

objectName - Object identifier

name - Name the listbox should contain

Documentation
Checks if listbox contains the given item.

Move To Position (int xPos, int yPos)


Arguments

xPos - Move the cursor to the x coordinate

yPos - Move the cursor to the y coordinate 

Documentation
Move mouse cursor to given position.

Move To Element (String objectName)


Arguments

objectName - Object identifier

Documentation
Move mouse cursor to given element.

Name Contains Text (String objectName, String text)


Arguments

objectName - Object identifier

text - Text the element should contain

Documentation
Verifies if element name contains to name.

Name Should Be (String objectName, String name)


Arguments

objectName - Object identifier

name - Name the element should be

Documentation
Verifies if name from element is equal.

Select Listbox Item By Name (String objectName, String name)


Arguments

objectName - Object identifier

name - Name of the listbox item to select

Documentation
Selects item from listbox by name.

Select Tab Item By Name (String objectName, String name)


Arguments

objectName - Object identifier

name - Name of the tab to select

Documentation

Select the item in the selected tab by name

Select Treeitem (String objectName)


Arguments

objectName - Object identifier

Set Checkbox State (String objectName, Boolean state)


Arguments

objectName - Object identifier

state - State of the checkbox

Documentation
Set checkbox state to True or False

Wait Until Element Is Responsive (String objectName)


Arguments

objectName - Object identifier

Documentation
Waits until element is responsive or timeout was reached.