google / google/EarlGrey

Interaction cannot continue because the desired element was not found

Open
#1,285 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

Hello,
I am running into a strange issue with below implementation, exception provided below.
grey_accessibilityLabel("LoginID")).assert(grey_sufficientlyVisible())
The Label indicated above is based on accessibility inspector and I am confused why the desired element is not found on the screen, there was another element on the same screen I was easily able to tap with the script based on accessibility label.any thoughts?is there any way I can capture and log all the tappable or editable elements on a screen ?

EarlGrey.selectElement(with:
grey_accessibilityLabel("Contact Us")).atIndex(UInt(0))
.perform(grey_tap()) //This implementation was sucessful

Exception: com.google.earlgrey.ElementInteractionErrorDomain

Exception Name: com.google.earlgrey.ElementInteractionErrorDomain
Exception Reason: {
"User Info" : {
"NSLocalizedDescription" : "Interaction cannot continue because the desired element was not found."
},
"Error Info" : {
"Search API Info" : "",
"Recovery Suggestion" : "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element.",
"Assertion Criteria" : "assertWithMatcher:sufficientlyVisible(Expected: 0.750000, Actual: 0.000000)",
"Element Matcher" : "((respondsToSelector(isAccessibilityElement) && isAccessibilityElement) && accessibilityValue('Enter Online ID'))"
},

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the EarlGrey.selectElement interaction using grey_accessibilityLabel("LoginID") and grey_sufficientlyVisible(), then compare it with the successful "Contact Us" interaction. Inspect the UI hierarchy and the reported matcher output; done means explaining why the element is not found and defining a verified way to identify or log the target element.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, swift
Domain
mobile, 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.