Legacy | UFT Function Reference: MNativeElement

Performs different actions with a native element, such as clicking, setting text, and retrieving the specified element property.

Locating the Element Identifier

Use the Legacy | Perfecto IDE object locator to generate a unique element identifier, assigned as the Element Identifier.

The XPath is automatically generated as the element identifier. If the object has an ID, the XPath will be based on the ID; otherwise, the full path in the tree is used.

Other identification methods (class, text or partial text) may be used. These values must be entered.

Properties

The built-in MNativeElement properties that can be retrieved from the MNativeElement include:

  • y
  • x
  • width
  • visibility
  • text
  • report_image_resolution
  • opaque
  • height
  • disabled
  • class
  • by
Note:

When trying to retrieve information using a property not listed here, it will be recorded as GetControlProperty.

Functions

Name Arguments Description
Click Timeout Clicks on a control by calling the control API.
GetControlProperty Property
Timeout
Retrieves the text value of a native element control.
Set Text
Timeout
Sets the control text, by calling the control set text API.
Set Secure Timeout Receives an encrypted string, decrypts it and sets the control text, by calling the control set text API.
Additional UFT functions

Examples

UFT Mobile Code Syntax Description
Device("DUT").MNativeElement("MNativeElement").Click On the device under test (DUT), clicks on a web element.
Device("DUT").MNativeElement("MNativeElement").Set "Perfecto Mobile" On the DUT, sets the text of a native element to "Perfecto Mobile"
Device("DUT").MNativeElement("MWebElement").GetROProperty "text" On the DUT, retrieves the text value of the edit field property from the MNativeElement object