Unable to retrieve value stored in text element

Unable to retrieve value stored in text element


Often the value entered in the fields is confused with text. But it is the value of the value attribute of a text field that is returned in the form of a string. So, instead of the NLP Store text from the element element into a variable test data, the NLP Store the value for the attribute attribute of the element element into a variable test data should be used.

To identify if a web element holds a value or a text follow the below steps:

  1. Right-click on the element and select Inspect from the drop-down list
  2. inspect_web_element
  3. On the developer console:
    1. Type or paste the following code into the Console, and then press Enter:
      $0.innerText

      If the expected string is returned, the web element holds a text. In such cases, the NLP Store text from the element element into a variable test data should be used.
    value_webelement
  4. If the returned value is null, type or paste the following code into the console and press Enter.
    $0.value

    If the expected string is returned, the web element holds a value. In such cases, the NLP Store the value for the attribute attribute of the element element into a variable test data should be used.
  5. value_webelement