appium / appium-inspector

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server
https://appium.github.io/appium-inspector/
Other
1.16k stars 285 forks source link

Appium inspector: Unable to inspect an element #1334

Closed hananurrehman closed 8 months ago

hananurrehman commented 8 months ago

Do I have the most recent component updates?

Is the component officially supported by the Appium team?

Is there an existing issue for this?

Current Behavior

I'm trying to select the following element: image

But appium inspector is unable to click on it. I'm able to select it from the App source section but in the tests wdio is then unable to find it. This is how I'm trying to assert it: await expect($('//android.widget.TextView[@text="Catalog"]')).toHaveText( "Catalog" );

Expected Behavior

Element should be selectable from the inspector and wdio should be able to assert on it.

Minimal Reproducible Example

Repo: https://github.com/hananurrehman/appiumpractice/blob/master/test/spec/tests.js

Environment

No response

Link to Appium Logs

No response

Further Information

No response

eglitise commented 8 months ago

When you say 'appium inspector is unable to click on it', do you mean selecting the element by clicking on the screenshot? Since you are also saying that you can select it using the app source. If yes, it's likely there are multiple elements overlapping there, so you may want to use the element handles toggle: https://appium.github.io/appium-inspector/latest/session-inspector/screenshot/#element-handles-toggle

Your other issue with WDIO not being able to find the element is not related to the Inspector. But since the Inspector itself is using WDIO under the hood, you may want to double check your locators by using the element search functionality in the app header: https://appium.github.io/appium-inspector/latest/session-inspector/header/#search-for-element

hananurrehman commented 8 months ago

Thanks I'll try this out.