[Mobile] Get Attribute


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/mobile-get-attribute.html

Hi I have object that has attributes like this. I expected the Mobile.getText to return value that is highlighted, but it did not. I also tried Mobile.getAttribute(findTestObject(‘Captured_Objects/btn_Fahrten’), ‘content-desc’ ,0). Did not work either.



Is there any way that I can capture such object and fetch the value I need? (“Highlighted in the second screenshot”)

Hello,

I have the same problem, did you find any solution, please?

Regards

How about at least giving the application a slight bit of timeOut, like 5? So, previous OP’s statement was:

Mobile.getAttribute(findTestObject('Captured_Objects/btn_Fahrten'), 'content-desc' , 0)

change it to:

Mobile.getAttribute(findTestObject('Captured_Objects/btn_Fahrten'), 'content-desc' , 5)

Hello,

I used Mobile.getAttribute(findTestObject(‘Captured_Objects/object’), ‘content-desc’ , 5) .But I still have the same problem

Is the above attribute the one that has the information you want?

yes, I need to get its attribute and compare it with another value

Perhaps you should put in a wait or delay statement above the getAttribute to check if you are trying to get the attribute too soon.

I added a timeout but it still returns an empty value ‘’.