Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section includes the detailed documentation for the following object classes of Mobile.

Mobile General Actions

Mobile.DragAndDropToObject

This action drags the specified mobile object and drops on another specified mobile object. 
Input Parameters:

Parameter NaneParameter DescriptionMandatoryData Type
dragLocatorThe locator value of the mobile element you want to drag.YesString
dragLocatorTypeThe locator type of mobile element you want to drag.YesString
dropToLocatorThe locator value of the mobile element on which you want to drop.YesString
dropToLocatorTypeThe locator type of the mobile element on which you want to drop.YesString
Example:
Mobile.DragAndDropToObject  dragLocator    dragLocatorType    dropToLocator    dropToLocatorType

Mobile.CloseApp

This action closes the specified application or mobile browser.

...

As the mobile app is closed, you cannot have any mobile action after the step containing this action.

Example:
Mobile.CloseApp

Mobile.HideKeyboard

This action hides the keyboard if present on the screen.

...


Example:
Mobile.HideKeyboard                       "Tap_Outside"         "Done"

Mobile.OpenApp

This action launches native/hybrid mobile Android or iOS application on the mobile device (emulator or physical). If the app does not exist in the device, this action will take the APK/ IPA file path specified and install it on the device before launching it.

...

Mobile.OpenApp                         "D:\myapp.apk"            "com.app.package"                  "com.app.package.MainActivity"

Mobile.PressAt

This action clicks at the specified point on the device screen.

...

Mobile.PressAt  "5"   "10"

Mobile.PressHomeButton

This action opens the home screen of the device. 

...

Example:
Mobile.PressHomeButton

Mobile.PressRecentsButton

This action shows the recent application.

...

Example:
Mobile.PressRecentsButton


...

Mobile.SwitchApp

This action launches new native/hybrid mobile Android or iOS application to which you want to switch from the already launched native/hybrid mobile application.

...

Mobile.SwitchApp               "com.app.package"                  "com.app.package.MainActivity"


SwitchWebExecutionPlatform

This action changes the current Web execution platform from Desktop to Mobile or from Mobile to Desktop. When used, web application test case will run on specified platform.

...

SwitchWebExecutionPlatform                        "Mobile"

Mobile.PressBackButton

This action taps back button on the Mobile device.

...

Example:
Mobile.PressBackButton

Mobile.StoreWebViewHandle

This action stores the web view handle under the specified key. The key value can be retrieved using the key name.

...


Example:
Mobile.StoreWebViewHandle                       "Key"

Mobile.SelectWebView

This action selects the web view present in the current page hybrid app. If key is provided (by using StoreWebViewHandle action), system selects the webview specified in key. If key is not provided, default webview will be selected.

...


Example:
Mobile.SelectWebView             "Key"

Mobile.SelectNativeContext

This action can be used to select native context from the hybrid app. 

...

Example:
Mobile.SelectNativeContext

Mobile.SelectWebViewUsingURL

This action selects the web view using the URL or pattern specified in the parameters.

...

Mobile.SelectWebviewUsingURL                      "www.google.com"                    "False"

Mobile.PressKeys

This action presses the specified keys using the mobile keyboard.

...

Mobile.Presskeys “CAP_LOCKED”


Mobile.Swipe

This action performs swipe based on the coordinates provided in the parameters.

...

Mobile.Swipe                  "100"          "123"         "145"             "121"            "1"

Mobile.OpenNotification

A notification is a message at the device level against the application and stored in the notification panel.

...

Example:

Mobile.OpenNotification

Mobile.VerifyToast

A toast provides simple feedback about an operation in a small popup.

...

Mobile Element Actions

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress


...

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

Example: StorePropertyValue                            "key"                     "text"


StoreVisibility

This action stores visibility of the mobile object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

Example:
StoreVisibility                               "Key"

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

Example: VerifyExistence                      "True"

WaitForObject (Deprecated)

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...

MobileButton Actions

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

StoreExistence

This action stores existence of the object under the specified key. The key value can be retrieved using the key name. 

...

StoreExistence                               "Key"

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress


...

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

StorePropertyValue                            "key"                     "text"

StoreVisibility

This action stores visibility of the mobile object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

Example:
StoreVisibility                               "Key"

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

VerifyExistence                      "True"

WaitForObject 

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...

MobileCheckbox Actions

Check

This action selects the specified check box.

This action does not have any parameter.

Example:

Check

CheckIfTrue

This action selects the check box, only if the parameter passed is True.

...

CheckIfTrue           "True"

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

...

On this page:

Table of Contents
maxLevel2
minLevel2

...

IsChecked

This action verifies whether the specified check box is selected.

...

IsChecked                           "True"

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress

StoreExistence

This action stores existence of the object under the specified key. The key value can be retrieved using the key name. 

...

StoreExistence                               "Key"

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

StorePropertyValue                            "key"                     "text"



StoreVisibility

This action stores visibility of the mobile object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

Example:
StoreVisibility                               "Key"

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

Uncheck

This action deselects the specified check box.

This action does not have any parameter.

Example:

UnCheck

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

VerifyExistence                      "True"

WaitForObject 

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...

MobileDropDown Actions


Note

These actions are available when working with the Android application testing only.

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress

SelectItemByName

This action selects the specified item from the MobileDropDown. The parameter value specified here is case-sensitive. 

...

SelectItemByName             "Qualitia"

...

On this page:

Table of Contents
maxLevel2
minLevel2
 

...

StoreExistence

This action stores existence of the object under the specified key. The key value can be retrieved using the key name. 

...

Example:
StoreExistence                               "Key"

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

StorePropertyValue                            "key"                     "text"



StoreVisibility

This action stores visibility of the mobile object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

Example:
StoreVisibility                               "Key"

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

VerifyExistence                      "True"

WaitForObject 

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...

MobileList Actions


Info

MobileList control is abstract control for any layout/widget having list-item like structures in UIAutomator.

UIAutomation such as Android (android.widget.ListView, any RelativeLayout having listItems child, elements grandchild, and TableLayout android.widget.GridView)

In the iOS platform, only UITable with UITableCell is seen (only that is supported for now).

The following limitations of the MobileList control are:

  • The MobileList control action is used only when a tree having multiple children at level 1 and there is only one child from level 2 to level n.
  • The MobileList control action doesn't support addressing the intermediate elements. Hence, you can use only when you want to address the leaf node/element.

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

ClickElement

This action clicks the element present at the specified location.

...

ClickElement                      "3"                    "2" 

CompareListItemMembersData

This action compares the data present at the specified list item member index.

...

CompareListItemMembersData             "2"              "Qualitia^QTP^WebDriver" 

CompareListItemData

This action compares the data present at the specified list item index.

...

CompareListItemData             "2"              "Qualitia^QTP^WebDriver"

...

On this page:

Table of Contents
maxLevel2
minLevel2

...

DeSelectCheckboxAtListItemMember

This action deselects the check box present at given list item index.

...

DeSelectCheckboxAtListItemMemberIndex                             "3"             "7"

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress

SelectCheckboxAtListItemMember

This action selects the check box present in the specified list item member. 

...

SelectCheckboxatListItemMember                     "5"           "4"

StoreExistence

This action stores existence of the object under the specified key. The key value can be retrieved using the key name. 

...

StoreExistence                               "Key"

StoreListItemCount

This action stores the count of list items in the specified key. The key value can be retrieved using the key name.

...

StoreListItemCount                  "Key"

StoreListItemIndexContainingMaxValue

This action stores the list item index which contains the maximum value. This action only works with numerical data.

...

StoreListItemIndexContainingMaxValue             "Key"             "1"

StoreListItemIndexContainingMinValue

This action stores the list item index which contains the minimum value. This action only works with numerical data.

...

StoreListItemIndexContainingMinValue             "Key"             "1"

StoreListItemIndexContainingText

This action stores the list item index which contains the specified text. 

...

StoreListItemIndexContainingText             "Key"              "Qualitia"              "1"

StoreListItemIndexContainingTextInArray

This action checks if each string separated by caret is part of the list item member data.

...

StoreListItemIndexContainingTextInArray                 "Key"               "d^f"                 "3"

StoreListItemMembersCount

This action stores the total count of the specified list item members under the specified key. The key value can be retrieved using the key name. 

...

StoreListItemMembersCount                       "Key"

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

StorePropertyValue                            "key"                     "text"


StoreVisibility

This action stores visibility of the mobile object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

Example:
StoreVisibility                               "Key"

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

VerifyDataExistenceInListItem

This action verifies the existence of the data in the specified list item.

...

VerifyDataExistenceInListItem                     "7"                  "Zensoft^9"              "True"

VerifyDataExistenceInListItemMembers

This action verifies the existence of the data present in the specified list item member index. 

...

VerifyDataExistenceInListItemMembers               "5"                  "Qualitia^6"              "False"

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

VerifyExistence                      "True"

VerifyListItemCount

This action verifies the total count of items present under the list with the expected specified count.

...

Example:
VerifyListItemCount               "5"

VerifyListItemMemberCount

This action verifies the list item member count with the expected specified count.

...

VerifyListItemMemberCount               "5"

VerifyText

This action verifies the actual data of the specified location matches with the expected data.

...

VerifyText                     "Qualitia"                 "3"                "1" 

WaitForObject (Deprecated)

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...

MobileText Actions

ClearText

This action clears the text present in the specified MobileEdit box.

This action does not have any parameter.

Example:
ClearText

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress

SecureSet

This action enters the value into the specified MobileEdit box. When you remove the mouse from the parameter in Test Case Editor screen, the value is displayed in the encrypted format.
Input Parameters:


Paramters NameParameter DescriptionMandatoryString
TextEnter the test that needs to be entered in the specified text box in the specified format.
Format: Encrypt(<TEXT TO BE ADDED>)
YesString

...

SecureSet   "Encrypt(Abc)". When you remove mouse from the parameter in Test Case Editor screen, you will view the data ABC as encrypted form such as "vHpmlfI4R3PQkCN4sZnuqw==þNWE3ZDdkNjE3N2JmNDM2ODgxMzQwYWI1MTA3YWNjMDc="

Set

This action sets the text into mobile text box object.

...

Set                        "Qualitia"

...

On this page:

Table of Contents
maxLevel2
minLevel2

...

StoreExistence

This action stores existence of the object under the specified key. The key value can be retrieved using the key name. 

...

StoreExistence                               "Key"

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

StorePropertyValue                            "key"                     "text"

StoreText

This action reads the existing text available in mobile text box and stores it into the specified key. 

...

StoreText                       "Key"

StoreVisibility

This action stores visibility of the object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

StoreVisibilty                      "Key"

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

VerifyExistence                      "True"

WaitForObject 

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...

MobileRadioButton Actions


Note

These actions are available when working with the Android application testing only.

Click

This action clicks the specified object.

This action does not have any parameter.

Example:

Click

IsSelected

This action verifies whether the radio button is selected or deselected.

...

IsSelected                    "True"

LongPress

This action performs the long press event on the specified object. 

This action does not have any parameter.

Example:

LongPress

Select

This action selects the specified radio button.

...

On this page:

Table of Contents
maxLevel2
minLevel2

...

SelectByIndex

This action selects the specified radio button based on its index number. The index starts from 1. This action should be used only when radio button is part of a radio-group and group has a valid resource ID on Android.

...

SelectByIndex              "com.sample.app:id/radiogroup1"         "2"

SelectIfTrue

This action selects the radio button if parameter passed is TRUE.

...

SelectIfTrue                        "True"

StoreExistence

This action stores existence of the object under the specified key. The key value can be retrieved using the key name. 

...

StoreExistence                               "Key"

StorePropertyValue

This action stores the property of the specified object under the key name. The stored key value can be retrieved using the key name.

...

StorePropertyValue                            "key"                     "text"


StoreVisibility

This action stores visibility of the mobile object under the specified key. The key value can be retrieved using the key name. 
Input Parameters:

...

Example:
StoreVisibility                               "Key"

Swipe

This action performs swipe and finds object until timeout occurs.

...

Swipe                  "up"                   "10"             "1"

VerifyEnability

This action verifies the enability of the specified object. 

...

Parameter Name

Parameter Description

Mandatory

Data Type

enability

Value for this parameter can be True or False.

  • Set True if you want to verify that the object is enabled. 
  • Set False if you want to verify that the object is disabled.
    Note: If you do not enter any value, the default value is set to True during the test case execution.

No

String

Example:

VerifyEnability                          "True"

VerifyExistence

This action verifies the existence of the specified object. 

...

VerifyExistence                      "True"

WaitForObject

This action waits for the object to appear or disappear for the maximum number of seconds specified.

...