Jeff_HJ
December 5, 2024, 10:19pm
1
I need to capture an element in my automated tests with Appium in android, this element is of type CardView CardView | Android Developers and I can’t capture it in the Appium Inspector how could I capture it?
I tried using the following selector:
//androidx.cardview.widget.CardView[1]
You can see the component tree here:
Aleksei
December 6, 2024, 10:05am
2
for example
// Java
WebElement el = driver.findElement(AppiumBy.className("className = \"androidx.cardview.widget.CardView\""));
1 Like
Jeff_HJ
December 15, 2024, 2:06am
3
This didn’t really work for me, I tried in the inspector and in my script and I could not find the element
Aleksei
December 15, 2024, 7:32am
4
Ok. Print output of page source. And check you can find your element there.
Jeff_HJ
December 17, 2024, 3:46pm
5
I tried that and I didn’t see any element that has this class CardView
Aleksei
December 17, 2024, 4:31pm
6
Look more for text values near. They should help you to find needed element.