Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can use tools to get android view element.

With UIAutomatorViewer (recommanded)

Install uiautomatorviewer on your PC

  • Install Android Studio if you have not

  • On Android Studio, click on Menu Tools > SDK Manager

  • Go to SDK tools tab, uncheck option "Hide Obsolete Packages"

  • Check option “Android SDK Tools” and install version 26.1.1

  • UIautomatorviewer is now install in android SDK directory

...

Note

UIAutomatorviewer need a JDK 1.8 by default to work

Launching UIAutomatorviewer without installingd a JDK 1.8 (recommanded)

To avoid installing a different version of java, you could :

...

  • The following program appears :

...

Launching Uiautomatorviewer with installation of JDK 1.8

Note

Could be difficult to have the good jdk version to work with your sdk

...

  • The following program appears :

...

Using UIAutomatorviewer

when UIAutomatorviewer is opened, you can

...

  • In this case, the tab “Actu” have the field ‘text’ set with ‘Actu’. So in GDSL we can search the text Actu to find this tab (if there is no other element with the same text in the screen).

  • Each element of a view can be retrieve by field ‘text’, ‘resource-id’, ‘class’ or ‘content-desc’. GDSL commands are made to find an element by searching on this field

    • clickById,exampleid : click on an element which have exampleid in resource-id field

    • waitUntilText,Actu : Wait an element which have ‘Actu’ in text field

Via Accessibility Scanner

An alternative to UIAutomatorviewer could be to use Accessibility Scanner directly on your phone

...