appium / appium/java-client

AndroidFindBy View Tag Support

Open
#1,269 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'd like to use the @AndroidFindBy annotation for finding elements by view tag on Android, I am specifying a test ID through this attribute as we cannot use resource ids for targeting views when using React Native.

It does not seem like @AndroidFindBy currently supports this. I see MobileBy.ByAndroidViewTag, but I believe this cannot be used with the page object model to initially locate elements.

Is the only workaround an xpath selector (which I believe requires knowing the tag name in advance in addition to the view tag)?
e.g. driver.findElementByXPath("//android.widget.TextView[@view-tag='some-tag']"

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 with @AndroidFindBy and MobileBy.ByAndroidViewTag, then trace how AndroidFindBy locates elements through the page object model. Check the existing annotation behavior and related tests, if present, to determine how view-tag lookup should be exposed. Done means page objects can locate Android views by tag without requiring an XPath workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.