Legacy | UFT Function Reference: MButton
A Mobile Button. A button object identified on the device screen based on an image or text label. It can be found and clicked.
MButton is an improved tailored version of the generic MObject class. It is optimized for buttons in multiple platforms. It internally optimizes the identification of the mobile object, per platform. This means that the user does not need to manually optimize the object identification (i.e. with the OCR parameters), as this is already done in the background, by the system and optimized per used platform.
MButton has a default timeout of 20 seconds. This means that there is a built-in synchronization point completed before the button actually appears. This is like other UFT objects.
Properties
The built-in MButton properties that can be retrieved from the MButton include:
- button_type
- label
- edit_type
- label
- y
- x
- whole_words_search
- visual_relation_inline
- visual_relation_direction
- threshold
- scroll_and_search
- screen_source
- restrict_dictionary_finding
- report_image_resolution
- policy
- operation
- ocr_white_level
- ocr_unsharp_radius
- ocr_unsharp_amount
- ocr_languages
- ocr_generic
- ocr_gamma
- ocr_dpi
- ocr_contrast
- ocr_brightness
- ocr_black_level
- next
- max_scroll
- match_mode
- match_grade
- label_width
- label_top
- label_offset
- label_left
- label_height
- inverted_text
- interval
- index
- ignore_whitespaces
- ignore_punctuation
- ignore_case
- haystack_width
- haystack_top
- haystack_left
- haystack_height
- filter_garbage
- exact_phrase
- backlight
- analysis_retries
- analysis_mode
Functions
Name | Arguments | Description |
---|---|---|
Click | timeout | Select an image/text button on the device screen. |
Find | timeout | Find an image/text button on the device screen, and return a Boolean value response. |
GetROProperty | Property | Return the current value of the specified identification property from the object in the application. |
Additional UFT functions |
|
|
Example
UFT Mobile Code Syntax | Description |
---|---|
Device("DUT").MButton("image").Click | On the device under test (DUT), identifies a button object, based on an image label, and clicks on it. |
Device("DUT").MButton("image").Find | On the DUT, finds a button object, on the device screen, and returns a Boolean value response. |