MobileEdit Object

Description

An edit box control in a mobile application.

Operations

The sections below list the built-in methods and properties that you can use as operations for the MobileEdit object.

Note: You can also view a list and descriptions of the MobileEdit 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

Common Method CheckChecks whether the actual value of an item matches the expected value.
Common Method CheckPropertyChecks whether the specified object property achieves the specified value within the specified timeout.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Common Method GetROPropertyReturns the current value of the specified description property from the object in the application.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
Common Method HighlightHighlights the object in the application.
Method LongPressPresses and holds the object for a moment.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Method PanPerform a Pan gesture on the object. (iOS Only)
Method PinchPerform a Pinch gesture on the object. (iOS Only)
Common Method RefreshObjectInstructs UFT One to re-identify the object in the application the next time a step refers to this object.
Method SetSets the specified text in the edit box.
Method SetFocusBrings the edit box into focus.
Method SetSecureSets the encrypted value of an edit box.
Common Method SetTOPropertySets the value of the specified description property in the test object description.
Method SwipeSwipes the object in the specified direction.
Method TapTaps the object.
Common Method ToStringReturns a string that represents the current test object.
Common Method WaitPropertyWaits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Properties

Common Property ExistChecks whether the object currently exists in the open application.

Back to top

 

LongPress Method

Description

Presses and holds the object for a moment.

Syntax

object.LongPress [x], [y], [Duration], [NumOfTouchPoints], [Gesture]

Arguments

ParameterDescription
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)
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:
 - This argument is necessary only if the application developer overrode the default iOS gesture class.
 - If this argument is necessary, it is recorded when you perform the gesture on the mobile object during a record session.
   If you manually add any steps to the test that perform the same gesture on the same mobile object, use the recorded gesture class for this argument.


Default value = ""

Return Type

None

Back to top

 

Pan Method

Description

Perform a Pan gesture on the object. (iOS Only)

Syntax

object.Pan StartX, StartY, EndX, EndY, [XVelocity], [YVelocity], [Gesture]

Arguments

ParameterDescription
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:
 - This argument is necessary only if the application developer overrode the default iOS gesture class.
 - If this argument is necessary, it is recorded when you perform the gesture on the mobile object during a record session.
   If you manually add any steps to the test that perform the same gesture on the same mobile object, use the recorded gesture class for this argument.


Default value = ""

Return Type

None

Example

Back to top

 

Pinch Method

Description

Perform a Pinch gesture on the object. (iOS Only)

Syntax

object.Pinch Scale, [Velocity], [x], [y], [Gesture]

Arguments

ParameterDescription
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:
 - This argument is necessary only if the application developer overrode the default iOS gesture class.
 - If this argument is necessary, it is recorded when you perform the gesture on the mobile object during a record session.
   If you manually add any steps to the test that perform the same gesture on the same mobile object, use the recorded gesture class for this argument.


Default value = ""

Return Type

None

Example

Back to top

 

Set Method

Description

Sets the specified text in the edit box.

Syntax

object.Set Text

Arguments

ParameterDescription
Text Required. A String value.
The text to enter in the edit box.

Return Type

None

Example

Back to top

 

SetFocus Method

Description

Brings the edit box into focus.

Syntax

object.SetFocus

Return Type

None

Example

Back to top

 

SetSecure Method

Description

Sets the encrypted value of an edit box.

Syntax

object.SetSecure EncryptedText

Arguments

ParameterDescription
EncryptedText Required. A String value.
The encrypted text to be entered in the edit field.

Return Type

None

IMPORTANT

The SetSecure method is recorded when a password or other secure text is entered. The text is encrypted while recording, and decrypted during the test run.

To find the encrypted value to use as the argument for the SetSecure method, use the Password Encoder utility (Start > All Programs > Micro Focus > Micro Focus UFT One > Tools > Password Encoder) or parameterize the argument using a Data Table parameter and use the Data Table encryption option (right-click each unencrypted value in the password column and choose Data > Encrypt). For more information, refer to the UFT One User Guide.

While the SetSecure method enables you to hide passwords on the screen during a run session, it is not intended to be a secure way to protect password information.

Back to top

 

Swipe Method

Description

Swipes the object in the specified direction.

Syntax

object.Swipe Direction, [x], [y], [Gesture]

Arguments

ParameterDescription
Direction Required. A String value.

The direction in which to swipe the object.

Possible values:
- up
- down
- left
- right

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:
 - This argument is necessary only if the application developer overrode the default iOS gesture class.
 - If this argument is necessary, it is recorded when you perform the gesture on the mobile object during a record session.
   If you manually add any steps to the test that perform the same gesture on the same mobile object, use the recorded gesture class for this argument.


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

Back to top

 

Tap Method

Description

Taps the object.

Syntax

object.Tap [x], [y], [NumberOfTaps], [NumOfTouchPoints], [Gesture]

Arguments

ParameterDescription
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:
 - This argument is necessary only if the application developer overrode the default iOS gesture class.
 - If this argument is necessary, it is recorded when you perform the gesture on the mobile object during a record session.
   If you manually add any steps to the test that perform the same gesture on the same mobile object, use the recorded gesture class for this argument.


Default value = ""

Return Type

None

Example

Back to top

See also: