appium / appium/java-client

The "equals" method of MobileElement/RemoteWebElement is not consistent for native apps.

Open
#227 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

WebElement e1 = driver.findElement(By. some constant locator);
WebElement e2 = driver.findElement(By. some constant locator);
e1.equals(e2);// is always "false"

for native apps. It happens because used automation tools always returns different ID's each time when client tries to find (the same) element. @bootstraponline told me this. This issue were found a month ago when I was working on features for .Net client. There were more foreground things... But now I can't keep calm anymore :)

There are two ideas:

  • the first is to perform comparison only on the client side. There would be large scripts for each supported platform.
  • the second is to perform comparison on the server side. We could ask other team to implement a server side command that would return "true" when elements are equal and "false" otherwise. But at this case the client has to be adapted to the new command as well.

@Jonahss
What would you choose or advise?

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 the equals methods on MobileElement and RemoteWebElement and the WebElement usage shown in the issue. Investigate how native-app element IDs are returned, then clarify whether the intended change is client-side comparison or a new server-side command; done means the chosen behavior is agreed and supported by the Java client.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile, testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.