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

**URL:** <https://forum.katalon.com/t/how-to-store-the-value-of-content-desc-in-string-and-print-it/78435>\
**Category:** Mobile Testing\
**Tags:** mobile-testing, katalon-studio\
**Created:** [September 12, 2022, 8:19am UTC](https://forum.katalon.com/t/how-to-store-the-value-of-content-desc-in-string-and-print-it/78435 "2022-09-12T08:19:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![boby.hartanto](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/boby.hartanto/32/20464_2.png) [@boby.hartanto](https://forum.katalon.com/u/boby.hartanto)\
**Post date:** [September 12, 2022, 8:19am UTC](https://forum.katalon.com/t/how-to-store-the-value-of-content-desc-in-string-and-print-it/78435/1 "2022-09-12T08:19:21Z")

</div>

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

 ![Screenshot (1610)](https://europe1.discourse-cdn.com/katalon/original/3X/6/e/6e940ebe88e9e3d47fdb1284d7c97013a957b68a.png)

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: [https://docs.katalon.com/katalon-studio/docs/troubleshooting.html](https://docs.katalon.com/katalon-studio/docs/troubleshooting.html)**  
**================================================**

**09-12-2022 01:54:14 PM grand\_total = getValue().toString()**

**Elapsed time: 0.130s**

**Test Cases/MobileTesCovidDatangKeRS FAILED.**  
**Reason:**  
**java.lang.NullPointerException: Cannot invoke method getValue() on null object**  
\*\* at MobileTesCovidDatangKeRS.run(MobileTesCovidDatangKeRS:120)\*\*  
\*\* at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)\*\*  
\*\* at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)\*\*  
\*\* at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)\*\*  
\*\* at TempTestCase1662965539986.run(TempTestCase1662965539986.groovy:25)\*\*

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

 ![Screenshot (1612)](https://europe1.discourse-cdn.com/katalon/original/3X/1/0/1037929c51d7f0e47be8a88488b93836473f5caa.png)

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

---

<div class="post-metadata">

**Author:** ![chen.lee](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@chen.lee](https://forum.katalon.com/u/chen.lee)\
**Post date:** [September 12, 2022, 12:45pm UTC](https://forum.katalon.com/t/how-to-store-the-value-of-content-desc-in-string-and-print-it/78435/2 "2022-09-12T12:45:03Z")

</div>

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

> **[\[Mobile\] Get Attribute | Katalon Docs](https://docs.katalon.com/docs/katalon-studio-enterprise/keywords/mobile-keywords/mobile-get-attribute)**
>
> Description

---

<div class="post-metadata">

**Author:** ![boby.hartanto](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/boby.hartanto/32/20464_2.png) [@boby.hartanto](https://forum.katalon.com/u/boby.hartanto)\
**Post date:** [September 15, 2022, 8:51am UTC](https://forum.katalon.com/t/how-to-store-the-value-of-content-desc-in-string-and-print-it/78435/3 "2022-09-15T08:51:06Z")

</div>

![Screenshot (1640)](https://europe1.discourse-cdn.com/katalon/original/3X/4/b/4ba9fb36a9c663f2338a575de0c8163b6cc4066e.png)

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