appium / appium/java-client

InvalidSelectorException when using AndroidfindBy(accessibility)

Open
#1,253 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Similar to this issue but for android instead of ios.

AndroidFindBy(accessibility = "Open navigation drawer") causes an error:
org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session

I trie using an xpath that would look for the content-desc attribute, but got the same error.
//android.widget.ImageButton[@content-desc=\"Open navigation drawer\"

Java: 1.8
Selenium: 3.141.59
Node: 12.11.0
Appium: 1.11.0
Appium Java Client: 7.2.0
OS: Mac OS X Mojave 10.14.6
Emulator: Android 10
Maven: 3.6.2
JUnit: 4.12

I'm using these versions specifically because I need the automation tests to run with App Center.

Code To Reproduce Issue [ Good To Have ]

Honestly just used AndroidFindBy and when I accessed the WebElement in a later method, it throws the exception

Ecxeption stacktraces

Java log

Link to Appium logs

Appium logs

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing this AndroidFindBy(accessibility) report with the linked issue 184, then reproduce it using the listed Appium, Java client, Selenium, and Android versions. Inspect the linked Java and Appium logs to identify why the accessibility locator is sent as an unsupported strategy; done means the locator resolves without InvalidSelectorException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.