appium / appium/java-client

Feature: Search for an inner element by an image

Open
#1,891 10 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

Description

Implement search for an inner element by an image.

Environment

  • java-client: 8.3.0
  • Appium server version: 2.0.0-beta.65
  • Plugin: images@2.0.10
  • Ubuntu 20.04
  • Android
  • Emulator

Details

Currently, searching for an element by image works for a driver object.
Searching for an element using the root element object results in the error.

org.openqa.selenium.InvalidSelectorException: Locator Strategy '-image' is not supported for this session

Code To Reproduce Issue

public class MobileIcon extends Widget {

    protected MobileIcon(WebElement element) {
        super(element);
    }

    public Rectangle getRect() {
        return findElement(AppiumBy.image(imageRefB64)).getRect();
    }
}

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

No source file or test is named in the issue. Start with AppiumBy.image(imageRefB64) and the WebElement.findElement call in MobileIcon.getRect(), comparing driver-level image lookup with root-element lookup. Done means an inner-element image search works without InvalidSelectorException.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.