How to get specific value using Get Attribute?

Hi Team,

How can I extract/get the value of “progress” using GetAttribute Activity in mobile automation?

image

Attributes available
image
image

Please note I have tried using ContentDecription and it is giving me output as NULL.

Regards,
Rahul

Try for text attribute

that should have the entire content

1 Like
  • Android: contentDescription should work just fine!
  • What I think is happening is that your selector doesn’t actually finds the element but the Fuzzy selector always finds something, but something that doesn’t have an accessibilityId. In order to test this theory disable Fuzzy and Image and just leave the Selector. It should fail!
    Also you can edit the target and validate the fuzzy and if it doesn’t select a single element, then this also shows that it might pick up something else.
  • From looking at the selector, the accessibilityId shouldn’t be a part of the selector because as far as I understand that changes when progress happens. The selector generator can’t know that so it selects with the accessibilityId because it uniquely identifies the target element.
1 Like

Thanks @phaserescu for helping me out everytime, much appreciated :slight_smile:

After disabling fuzzy selector I’m getting the value as below

accessibilityId=‘membershipProgress, points: 29, current level: Silver, next level: Gold, points to next status: *, progress: 83%,’

Now, the progress value can be extracted using REGEX or is there any other property using which I can extract the progress value (83%) ?

Thanks!
Rahul

I’m glad you solve it!

I can’t think of any other. I guess it depends on the context and what specific widgets are used to render the progress bar.

Got it. Thanks Again @phaserescu :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.