# What is the syntax for ‘contains text()’ in Test Object scripting view when using variables?

**URL:** <https://forum.katalon.com/t/what-is-the-syntax-for-contains-text-in-test-object-scripting-view-when-using-variables/6723>\
**Category:** Miscellaneous\
**Tags:** katalon-studio\
**Created:** [October 9, 2017, 9:29pm UTC](https://forum.katalon.com/t/what-is-the-syntax-for-contains-text-in-test-object-scripting-view-when-using-variables/6723 "2017-10-09T21:29:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Brohin](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/alex_brohin/32/23869_2.png) [@Alex\_Brohin](https://forum.katalon.com/u/Alex_Brohin)\
**Post date:** [October 9, 2017, 9:29pm UTC](https://forum.katalon.com/t/what-is-the-syntax-for-contains-text-in-test-object-scripting-view-when-using-variables/6723/1 "2017-10-09T21:29:08Z")

</div>

Hi all,

I’m wondering, is it possible to modify the scripts with variables in a way that will allow us to ‘Click’ an element that contains ONLY some parts of the text ?

Here is an example:  
WebUI.click(findTestObject(‘Our locators/Transaction’, [(‘text’) : Timestamp  
, (‘class’) : ‘cx-item-contents cx-item-time col-md-3’]))

As you can see, we use a variable named ‘Timestamp’ here.  
What we want is to tell Katalon Studio to click an element that contains '1: 30 pm - ’ and not the whole time-stamp ‘1:30 pm - 2:40 pm’

So, how can we define that partial text in that script ?  
Is this something like :  
ConditionType.contains ???

Thanks!

---

<div class="post-metadata">

**Author:** ![Alex\_Brohin](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/alex_brohin/32/23869_2.png) [@Alex\_Brohin](https://forum.katalon.com/u/Alex_Brohin)\
**Post date:** [June 1, 2017, 11:54pm UTC](https://forum.katalon.com/t/what-is-the-syntax-for-contains-text-in-test-object-scripting-view-when-using-variables/6723/2 "2017-06-01T23:54:21Z")

</div>

Already,

we found that. It is built-in.  
While defining ‘Object’s properties’ you can select as many attributes as you need and next to the ‘text’ attribute just select ‘contains’ and then it should work.

text \> contains \> ${text}

---

<div class="post-metadata">

**Author:** ![pgonzalez](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pgonzalez](https://forum.katalon.com/u/pgonzalez)\
**Post date:** [March 22, 2019, 4:46am UTC](https://forum.katalon.com/t/what-is-the-syntax-for-contains-text-in-test-object-scripting-view-when-using-variables/6723/3 "2019-03-22T04:46:53Z")

</div>

hi can you show this in an example or manual mode??
