Skip to content

support UIAutomator2 #505

Closed
Closed
@KazuCocoa

Description

@KazuCocoa

UiSelector().textContains(\"some value\") and UiSelector().text(\"some value\") seem broken but UiSelector().descriptionContains(\"some value\"), UiSelector().description(\"some value\"), UiSelector().resourceId(\"some value\") work fine in my environments.

So, I'd like to update some convenience methods to avoid some errors or investigate and fix https://github.com/appium/appium-uiautomator2-server or use XPath mainly for Android such as java-client.

For example, we can replace current find/s_exact to the following method. (be able to find visible elements)

  • find/s_exact
find_element/s :xpath, "//*[@text='#{value}' or @content-desc='#{value}' or @resource-id='#{value}']"

I should investigate some contains work or not. If contains works, I can replace contains method.

//#{class_name}[@visible="true" and contains(translate(@#{attr},'#{value.upcase}', '#{value}'), '#{value}')]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions