Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for filtering elements by a property #1881

Open
mvysny opened this issue Mar 10, 2025 · 1 comment
Open

Add support for filtering elements by a property #1881

mvysny opened this issue Mar 10, 2025 · 1 comment

Comments

@mvysny
Copy link
Member

mvysny commented Mar 10, 2025

Say I want to find a Dialog with headerTitle xyz. I would like to write $(DialogElement.class).property("headerTitle", "xyz").first().

TestBench 23

@mvysny
Copy link
Member Author

mvysny commented Mar 10, 2025

Workaround:

$(DialogElement.class).all().stream()
                .filter(it -> caption.equals(it.getPropertyString("headerTitle")))
                .findFirst()
                .orElseThrow(() -> new java.util.NoSuchElementException("No Dialog with header title " + caption));

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

No branches or pull requests

1 participant