getText for "readonly" text from <input> box


Hello all,
I looking for some help in reading value from an input box that actually has a “readonly” value pushed from the api.
When i inspect it, there is no text seen anywhere but i could see it under Network log >> Preview
Please refer to the element below.
<input type=“text” class=“v-textfield v-widget v-readonly v-has-width v-textfield-readonly” id=“EventId:” aria-labelledby=“gwt-uid-120” tabindex="-1" readonly="" style=“width: 100%;” xpath=“1”>

In the attached image, i am trying to get the readonly text value which is “5,913”.
I tried WebUI.getText(findTestObject(‘test_object’)), but it didn’t work as it gets only the visible inner text.

Please let me know if there is any solution for this.
Thank you in advance.


You want WebUI.getAttribute and specify the value attribute. Like many people (including me), you expect getText to be the mirror of setText - not so.


Cool… that worked… thank you so much :slight_smile:

String text = WebUI.getAttribute(findTestObject(‘test_object’), ‘value’)