Skip to content

Attribute missing on iOS #271

Description

@tranvanhien187

Mobilewright version

v0.0.53

Operating system

macOS

Target platform

iOS

Device or simulator

All devices

Minimal reproduction

Mobile cli v1.0.1

Raw (--format raw)

Parent Button is disabled (enabled: false). Child StaticText is enabled.

{
  "elementType": 9,
  "label": "Confirm",
  "identifier": "",
  "enabled": false,
  "hasFocus": false,
  "selected": false,
  "frame": { "X": 291, "Y": 790, "Width": 101, "Height": 40 },
  "children": [{
    "elementType": 48,
    "label": "Confirm",
    "enabled": true,
    "frame": { "X": 311, "Y": 800, "Width": 61, "Height": 20 }
  }]
}

Formatted (default)

{
  "type": "Button",
  "label": "Confirm",
  "name": "Confirm",
  "rect": { "x": 291, "y": 790, "width": 101, "height": 40 },
  "children": [{
    "type": "StaticText",
    "label": "Confirm",
    "name": "Confirm",
    "rect": { "x": 311, "y": 800, "width": 61, "height": 20 }
  }]
}

Actual behavior

Receive wrong value of the view status

Expected behavior

Receive actual value of the view status

Additional context

Summary

The formatted UI output from the mobilecli dump command on iOS does not display as much information as the raw WDA tree, making it impossible to inspect locator attributes on iOS.

Impact on automation

  • Detect disabled controls (enabled: false)
  • Detect selected tabs/chips (selected)
  • Detect focus (hasFocus)

Proposed fixes

In devices/devicekit/source.go:

  • Add Enabled, Focused, Selected Checked to sourceTreeElement
  • Map into ScreenElement using Android convention:
    • enabled → only when false
    • focused / selected / checked → only when true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions