This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

For native we have coded as the Automation-id but in UiAutomator it is showing as Content-desc is it the general way of writing the XPath using content-desc or there is any other way to use that to write XPath. Can you help me out with the sample XPath instance .

Thanks In advance

  • created

    Nov '18
  • last reply

    Nov '18
  • 1

    reply

  • 104

    views

  • 2

    users

Here is a syntax that i use usually when dealing with xpath selection:

xpath("//*[@content-desc=“foo” ]")

some extra syntaxes:
you can use some logic gate as OR AND
xpath("//*[@text=“foo” or @label=“foo” ]")

syntax using contains:
xpath("//*[contains(@text, “f”)]")