Can’t get text from View

Good afternoon,

I’m trying to get the text of a View with the getText() method. I’m referring to this documentation : https://docs.katalon.com/display/KD/%5BMobile%5D+Get+Text

But Katalon isn’t able to retrieve any text from my object. Is it because it’s not a TextView object?

Thank you for you answer.

Good morning,

Thank you for you answer… but it doesn’t work. When I retrieve the “text” attribute, it just prints me an empty string. And the “value” attribute prints “null”…

bump… Same here, cannot get a text value from a field. My script finds the objects, I havea 2 seconds wait before, so the page is populated, but the value gettext finds is null ‘’

1 Like

It seems that when we build our angular website with the -prod mode, some attributes like ng-model are not visible. The field is populated with a value, but that value is not visible anywhere on the page source… There must be a way to see what’s invisible, right ?

I am having the same issue ,I know the code to refer the element in angular , but how do we run the angular command as a step in katalon studio

WebUI.getAttribute(findTestObject('testObjectPath'), 'value'))

This works for me, I was able to get the text of the text field where the getText method was giving me null values. But make sure the element is loaded properly otherwise you might get StaleElementException

2 Likes

@Zeeshan_Shaikh , this worked for me! We are using Angular and Angular Material. I’m finding Angular Material to have a few quirks from a testing stand point but it’s making be a little more creative too. Thanks so much!