Use Selectors for Mobile Sessions

Identify selectors and filter sessions with selectors

Filtering by selectors

LogRocket automatically captures every user interaction with your application - allowing you to search retroactively for sessions where users interacted with specific buttons or screens.

To search for sessions, use the "Clicked on Selector" filter as shown below:

13601360 12661266

Components of a View Selector

Selectors are generated from hierarchical view details and support a subset of the CSS specification syntax.

ComponentValueNote
Elementview.getClass().getSimpleName()
#resource-idview.getResources().getResourceName(view.getId())Only the portion after id/ is captured.
.tag-textview.getTag()Only instances of String are captured.

For example, an EditText with this definition:

  <EditText
    android:id="@+id/user_email"
    android:tag="test-email-input"
    ... />

the following Selector would be generated:

EditText.test-email-input#user_email

Querying Selectors

For each touch event, or 'click', a hierarchy of views is computed from the touched view to the top view of the Activity. The following forms of querying are supported:

  • Single element: Button -- will match any Button element.
  • Specific ID: #signin -- will match any view with a Resource ID of
  • Specific Tag: .tag-value -- will match any view with that tag text
  • Combined selectors: an element may be followed by either or both of a Specific ID and Specific Tag.
  • Nesting: multiple selectors may be separated by a space, and will enforce a mathing hierarchy.
  • Child Of: a selector in the form of a > b matches any view b that is a direct child of the view a.