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

fix: Fix xpath lookup for queries including attribute matching patterns (@*) #417

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

mykola-mokhnach
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach commented Mar 10, 2021

@mykola-mokhnach mykola-mokhnach changed the title [WIP] chore: Add asterisk xpath lookup test fix: Fix xpath lookup for queries including attribute matching patterns (@*) Mar 10, 2021
Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks 🚀

@@ -98,6 +98,10 @@ public void zzzFindElementTest() {
response = findElement(by);
assertTrue(response.isSuccessful());

by = By.xpath("//*[@*='android:id/action_bar']");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

private static Set<Attribute> extractQueriedAttributes(String xpathExpression) {
if (xpathExpression.contains("@*")) {
return null;
return new HashSet<>(Arrays.asList(UiElementSnapshot.SUPPORTED_ATTRIBUTES));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i see.

@mykola-mokhnach mykola-mokhnach merged commit 0d7b257 into appium:master Mar 10, 2021
@mykola-mokhnach mykola-mokhnach deleted the xpath branch March 10, 2021 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants