Skip to content

[UITest] Long accessibility identifier (>128 chars) causes WebDriverAgent failure #31504

@morning4coffe-dev

Description

@morning4coffe-dev

Description

When running MAUI UI tests (Appium / WebDriverAgent), querying an element whose accessibility identifier (or label/title/value) exceeds 128 characters triggers a failure.

Error: OpenQA.Selenium.UnknownErrorException: An unknown server-side error occurred while processing the command. Original error: Invalid query - string identifier 'This is a very long title that should wrap properly to multiple lines instead of being truncated or causing horizontal overflow issues like it might on Windows' exceeds maximum length of 128 characters. You can work around this limitation by constructing a query with a custom NSPredicate that specifies the property (label, title, value, placeholderValue, or identifier) to match against.

Steps to Reproduce

This issue appears e.g. with ActionSheetWithManyActionsShouldDisplayProperly when re-enabled (it happens only on macOS, as iOS shortens it).

Do something like something like

App.WaitForElement("This is a very long title that should wrap properly to multiple lines instead of being truncated or causing horizontal overflow issues like it might on Windows");

Link to public reproduction project repository

https://github.com/morning4coffe-dev/maui/blob/490f7386ecc37d753a3c37aafced7af3f5a1c00c/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25200.cs

Version with bug

10.0.0-preview.7

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

No response

Affected platforms

macOS, iOS

Affected platform versions

No response

Did you find any workaround?

Use an NSPredicate-based query manually (if the harness allows), e.g.: (name == 'full long string') OR (label == 'full long string') Or shorten the AutomationId/text below 129 chars (not ideal/possible in case of some controls, e.g. ActionSheet).

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testingUnit tests, device testsplatform/macosmacOS / Mac Catalysts/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions