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.11k stars 282 forks source link

bug: Android can't inspect BottomSheetDialogFragment elements #1557

Closed omerdurmaz2 closed 1 month ago

omerdurmaz2 commented 1 month ago

Is this an issue specifically with Appium Inspector?

Is there an existing issue for this?

Current Behavior

When i try to inspect this bottomsheet, I only see one element no child components. Screenshot 2024-07-17 at 14 51 20 (2)

Expected Behavior

I want to see the child elements in inspector just like this image. One of my bottomsheet works fine but the other one seems like one component no child component.

Screenshot 2024-07-17 at 14 51 38 (2)

Operating System

Mac

Appium Inspector Version

2024.6.1

Appium Version

2.10.3

Further Information

Note: Both of them BottomSheetDialogFragment and both of them developed with jetpack compose. What am i missing? Note: And I have already added testTag and

semantics {
    testTagsAsResourceId = true
}

modifiers.

eglitise commented 1 month ago

I'm not sure if anything can be done from the Inspector side here. The page source is retrieved using Google's UiAutomator framework, and the Appium server and Inspector only parse it. But looking at your first screenshot:

If the element details stay the same after refreshing the page source, then it is likely that the issue lies somewhere in your application code. Unfortunately I'm not an Android developer myself, so I can't help you with Compose questions; the only thing I know is the need for testTags, which you are already using.

mykola-mokhnach commented 1 month ago

You may also try https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#elements-cannot-be-found

Also, appium espresso driver has a built-in compose automation support. Check https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#jetpack-compose-support for more details

omerdurmaz2 commented 1 month ago

Thanks a lot! allowInvisibleElements parameter worked for me.