WebUI.getText returns null

Hi Community!

I’m trying to get the text inside of the Address Line 1 textfield after it is populated
but I’m getting null response to it

Script:

WebUI.setText(findTestObject('Payors/Add Payor/Demographics/txtAddress1CA'),tabDemographics.getValue('CA Address Line 1*',1))
WebUI.delay(30)
String CAAL1 = WebUI.getText(findTestObject('Payors/Add Payor/Demographics/txtAddress1CA'))
System.out.println("#######################################"+CAAL1)

HTML

Xpath
(//label[contains(text(),"Address Line 1*")]/..//input)[1]

Result:
Returns null

@Brylesu, maybe try the solution from this post here.

Works after trying

String CA = WebUI.getAttribute(findTestObject('Payors/Add Payor/Demographics/txtCAFields',[('fields') : fieldname.get(count)]), 'id')
String elementCA = WebUI.executeJavaScript("return document.getElementById('${CA}').value;",null)
2 Likes