How to store the value of content-desc in string and print it ??

I have a use case in my mobile application. I am trying to store the value of content-desc of an object called grand_total, and print them in console -log ,. I have tried a lot of syntax, but keep hitting the wall

This is my code ( the one that I boxed in)… And katalon said that the object is null object.

This is the full error message :
=============== ROOT CAUSE =====================

For trouble shooting, please visit:

09-12-2022 01:54:14 PM grand_total = getValue().toString()

Elapsed time: 0.130s

Test Cases/MobileTesCovidDatangKeRS FAILED.
java.lang.NullPointerException: Cannot invoke method getValue() on null object
** at**
** at**
** at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(**
** at com.kms.katalon.core.main.TestCaseExecutor.runScript(**
** at com.kms.katalon.core.main.TestCaseExecutor.doExecute(**
** at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(**
** at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(**
** at com.kms.katalon.core.main.TestCaseExecutor.execute(**
** at com.kms.katalon.core.main.TestCaseMain.runTestCase(**
** at com.kms.katalon.core.main.TestCaseMain.runTestCase(**
** at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)**
** at**

This is the object properties of the object that I want to extract the “content-desc” from

Nb: I already tried checklist all the “Detect object by” , and also tried to checklist only the “content-desc”, but I still cant store and print the value of content-desc.

Any help will be greatlty appreciated. Thanks

Maybe try using Mobile.getAttribute(grand_ttl, 'content-desc', 5).

1 Like

I already tried using your suggestion, but it also returned nothing… Any other suggestion ??