MobileList Object
Description
A list control in a mobile application, including Android RecyclerView objects.
IMPORTANT
- This test object is also used to represent mobile table objects.
This test object type is not supported for Flutter-based applications.
Operations
The sections below list the built-in methods and properties that you can use as operations for the MobileList object.
Note: You can also view a list and descriptions of the MobileList description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.
Methods
Check | Checks whether the actual value of an item matches the expected value. |
CheckProperty | Checks whether the specified object property achieves the specified value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
Delete | Deletes the specified item or section. |
GetROProperty | Returns the current value of the specified description property from the object in the application. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
Highlight | Highlights the object in the application. |
Insert | Inserts an item or section at the specified location in the list. |
LongPress | Presses and holds the object for a moment. |
MoveItem | Moves an item or section in the list. |
Output | Retrieves the current value of an item and stores it in a specified location. |
Pan | Perform a Pan gesture on the object. |
Pinch | Perform a Pinch gesture on the object. |
RefreshObject | Instructs UFT One to re-identify the object in the application the next time a step refers to this object. |
Scroll | Scrolls the list to the specified location. |
ScrollOnePage | Scrolls the list one page in the specified direction. |
ScrollToItem | Scrolls to the specified item using the object's label. |
ScrollToOffset | Scrolls to the specified point in the list. |
Select | Selects the specified item or section in the list. |
SelectItem | Selects the specified item using the object's label. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
Swipe | Swipes the object in the specified direction. |
Tap | Taps the object. |
ToString | Returns a string that represents the current test object. |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
Exist | Checks whether the object currently exists in the open application. |
Delete Method
Description
Deletes the specified item or section.
This method is supported for iOS devices only.
Syntax
object.Delete Item, [Section]
Arguments
Parameter | Description |
---|---|
Item |
Required. An integer value. The numeric index of the item to delete. |
Section |
Optional. An integer value. The numeric index of the section from which to delete the specified Item. Default value = -9999 |
Return Type
None
Insert Method
Description
Inserts an item or section at the specified location in the list.
This method is supported for iOS devices only.
Syntax
object.Insert Item, [Section]
Arguments
Parameter | Description |
---|---|
Item |
Required. An integer value. The numeric index of the location for the new item. |
Section |
Optional. An integer value. The numeric index of the section in which to insert the specified Item. Default value = -9999 |
Return Type
None
LongPress Method
Description
Presses and holds the object for a moment.
When testing RecyclerView controls on Android devices, this method is supported for replay only.
Syntax
object.LongPress [x], [y], [Duration], [NumOfTouchPoints], [Gesture]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the long press. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the long press. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Tip: You can enter micNoCoordinate (-9999) for the x and y argument values if you want to enter a value for the other optional arguments without specifying x- and y- coordinates for the long press. micNoCoordinate indicates the center of the object. Default value = -9999 |
Duration |
Optional. A double floating value. The number of seconds to continue pressing. (Supported only on iOS) Default value = 0 |
NumOfTouchPoints |
Optional. An integer value. The number of points to press, similar to the number of fingers you would use for the gesture on a real device. (Supported only on iOS) Supported value = 1 |
Gesture |
Optional. A String value. The gesture class designed by the mobile application developer to handle this gesture on this object. (relevant for iOS only) Note: Default value = "" |
Return Type
None
MoveItem Method
Description
Moves an item or section in the list.
This method is supported for iOS devices only.
Syntax
object.MoveItem SrcItem, DestItem, [SrcSection], [DestSection]
Arguments
Parameter | Description |
---|---|
SrcItem |
Required. An integer value. The numeric index of the item to move. |
DestItem |
Required. An integer value. The numeric index of the new location for the item. |
SrcSection |
Optional. An integer value. The numeric index of the section from which to move the specified SrcItem. Default value = -9999 |
DestSection |
Optional. An integer value. The numeric index of the section in which to place the specified DestItem. Default value = -9999 |
Return Type
None
Pan Method
Description
Perform a Pan gesture on the object.
When testing RecyclerView controls on Android devices, this method is supported for replay only.
Syntax
object.Pan StartX, StartY, EndX, EndY, [XVelocity], [YVelocity], [Gesture]
Arguments
Parameter | Description |
---|---|
StartX |
Required. An integer value. The x-coordinate at which to start the pan gesture. Note that the specified coordinates are relative to the upper left corner of the object. |
StartY |
Required. An integer value. The y-coordinate at which to start the pan gesture. Note that the specified coordinates are relative to the upper left corner of the object. |
EndX |
Required. An integer value. The x-coordinate at which to end the pan gesture. Note that the specified coordinates are relative to the upper left corner of the object. |
EndY |
Required. An integer value. The y-coordinate at which to end the pan gesture. Note that the specified coordinates are relative to the upper left corner of the object. |
XVelocity |
Optional. A double floating value. The horizontal velocity of the pan gesture. Default value = -9999 |
YVelocity |
Optional. A double floating value. The vertical velocity of the pan gesture. Default value = -9999 |
Gesture |
Optional. A String value. The gesture class designed by the mobile application developer to handle this gesture on this object. (relevant for iOS only) Note: Default value = "" |
Return Type
None
Example
'The following example performs a Pan gesture on a MobileObject object 'in a Mobile application. Device("Device").App("TouchesNI").MobileObject("yellow_view").Pan 46,20,58,137,-29.768660,44.604350
Pinch Method
Description
Perform a Pinch gesture on the object.
Syntax
object.Pinch Scale, [Velocity], [x], [y], [Gesture]
Arguments
Parameter | Description |
---|---|
Scale |
Required. A double floating value. The scale for the pinch gesture. This number is the ratio between the start distance and the end distance between the two touch point used for the pinch. For example, if you were to touch a screen with your fingers 6 cm apart, and pinch until your fingers were 3 cm, apart, the scale would be 0.5. |
Velocity |
Optional. A double floating value. The speed at which to perform the pinch gesture. This number specifies the scale factor per second. Meaning - ratio between the touch point distance at one second, and the touch point distance one second later. For example, if performing a pinch from 6 cm to 3 cm (0.5 scale) takes 2 seconds, then the velocity is 0.25. Default value = 0 |
x |
Optional. An integer value. The x-coordinate for the pinch gesture. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate for the pinch gesture. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
Gesture |
Optional. A String value. The gesture class designed by the mobile application developer to handle this gesture on this object. (relevant for iOS only) Note: Default value = "" |
Return Type
None
Example
'The following example performs a Pinch gesture on a MobileObject object 'in a Mobile application. Device("Device").App("TouchesNI").MobileObject("pink_View").Pinch 1.885921,0.700999,78,89
Scroll Method
Description
Scrolls the list to the specified location.
Syntax
object.Scroll y, [x]
Arguments
Parameter | Description |
---|---|
y |
Required. An integer value. For RecyclerView controls, this parameter represents the item's index. For example, a value of 1 represents the first item in the view. |
x |
Optional. An integer value. The x-coordinate for the scroll operation, in pixels (this scrolls horizontally, if supported by the control in the mobile application). Note that the specified coordinate is relative to the left side of the object. Default value = -9999 Not used for RecyclerView controls. |
Return Type
None
ScrollOnePage Method
Description
Scrolls the list one page in the specified direction.
This method is supported for iOS devices only.
Syntax
object.ScrollOnePage Direction
Arguments
Parameter | Description |
---|---|
Direction |
Required. A String value. The direction to scroll. Possible values:
|
Return Type
None
IMPORTANT
The forward and backward arguments are supported for backward compatibility only.
ScrollToItem Method
Description
Scrolls to the specified item using the object's label.
Syntax
object.ScrollToItem Item
Parameter | Description |
---|---|
Label |
Required. A string. The textual label of the object. |
Return Type
None
ScrollToOffset Method
Description
Scrolls to the specified point in the list.
This method is supported for iOS devices only.
Syntax
object.ScrollToOffset x, y
Arguments
Parameter | Description |
---|---|
x |
Required. An integer value. The x-coordinate for the scroll operation, in pixels. The specified coordinate is relative to the left side of the object. |
y |
Required. An integer value. The y-coordinate for the scroll operation, in pixels. The specified coordinate is relative to the top of the object. |
Return Type
None
IMPORTANT
Supported for iOS only.
Select Method
Description
Selects the specified item or section in the list.
Syntax
object.Select Item, [Section]
Arguments
Parameter | Description |
---|---|
Item |
Required. An integer value. The numeric index of the item to select. |
Section |
Optional. An integer value. Not used for RecyclerView controls. |
Return Type
None
Example
'The following example selects an item from a MobileList object in a 'native Mobile application. Device("Device").App("UICatalog").MobileList("list").Select 8
SelectItem Method
Description
Selects the specified item using the object's label.
This method is supported for iOS devices only.
Syntax
object.SelectItem label
Arguments
Parameter | Description |
---|---|
Label |
Required. A string. The textual label of the object. |
Return Type
None
Swipe Method
Description
Swipes the object in the specified direction.
When testing RecyclerView controls on Android devices, this method is supported for replay only.
Syntax
object.Swipe Direction, [x], [y], [Gesture]
Arguments
Parameter | Description |
---|---|
Direction |
Required. A String value. The direction in which to swipe the object. Possible values: |
x |
Optional. An integer value. The x-coordinate at which to start the swipe. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate at which to start the swipe. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
Gesture |
Optional. A String value. The gesture class designed by the mobile application developer to handle this gesture on this object. (relevant for iOS only) Note: Default value = "" |
Return Type
None
IMPORTANT
During recording sessions on Android devices, this method is not recorded. You can add it to the test manually.
Example
'The following example performs a Swipe gesture on a MobileObject object 'in a Mobile application. Device("Device").App("UICatalog").MobileObject("customviewpager").Swipe "up",545,1521
Tap Method
Description
Taps the object.
When testing RecyclerView controls on Android devices, this method is supported for replay only.
Syntax
object.Tap [x], [y], [NumberOfTaps], [NumOfTouchPoints], [Gesture]
Arguments
Parameter | Description |
---|---|
x |
Optional. An integer value. The x-coordinate of the tap. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
y |
Optional. An integer value. The y-coordinate of the tap. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
NumberOfTaps |
Optional. An integer value. The number of times to tap the object. (Supported only on iOS) Default value = 1 |
NumOfTouchPoints |
Optional. An integer value. The number of points to press, similar to the number of fingers you would use for the gesture on a real device. (Supported only on iOS) Default value = 1 |
Gesture |
Optional. A String value. The gesture class designed by the mobile application developer to handle this gesture on this object. (relevant for iOS only) Note: Default value = "" |
Return Type
None
Example
'The following example performs a Tap on a MobileObject object in 'a Mobile application. Device("Device").App("TouchesNI").MobileObject("yellow_view").Tap 49,58
See also: