Unable to get the text using getText and getAttribute methods

I am using getText method to get the text of a webElement. I am getting ‘null’ when trying to get the text instead of the value.

Alternatively, I tried getAttribute method to get the text. Same issue with this also.

Deleted the object from OR and captured it again and again.

Why is this happening ?

1 Like

There is an attribute ‘text’. I am using that to get the text with getAttribute method but the value it is returning is ‘null’.

getAttribute should have ‘value’ as an input attribute to get the value. Do you use that correctly?

Can someone guide me how to get the test from this?

  • : :before ** Mytext**
  • When i tried with gettext(), i am getting a space. Please suggest.

    custUrl = WebUI.getAttribute(findTestObject(‘Object Repository/QA2_OBP_OR/SettingsInTransactionPage_OR/input_customUrl’), ‘value’)

    WebUI.println('custUrl = '+ custUrl)

    payerUrl=WebUI.concatenate([baseUrl, custUrl] as String[],

    FailureHandling.STOP_ON_FAILURE)

    WebUI.println('payerUrl = '+ payerUrl)

    WebUI.navigateToUrl(payerUrl)

    WebUI.waitForPageLoad(20)

    Rama Chandra said:

    Can someone guide me how to get the test from this?

  • : :before ** Mytext**
  • When i tried with gettext(), i am getting a space. Please suggest.

    In your case Mytest is the text of href link. So you should get text of element with tag =