cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read textarea in HTML when value was loaded by JavaScript

KimmoKaukonen
Level 2
Hi, I'm having a problem when trying to read a value (for example word "Hello") from textarea element in HTML browser application
   <textarea id="txtReminder" rows="5"></textarea>

Textarea value is loaded from here:
   <script type="text/javascript">
   fsPageOnLoad:function(){contentPage.fsResultSet ={"reminder":"Hello"}}

When identifying element in Application Modeller I have chosen following:
   ElementType=TextEdit(Web)
   Web ID = txtReminder
   Web Element Type = TEXTAREA
and highlighting this element works fine.

For Read stage properties in Object Studio I've chosen:
   Data = Get Text
but this does not return the value "Hello" to me.

If I choose:
   Data = Get Attribute
   Attribute Name = "Web Value"
it does not work either, even when spying element (Browser mode) the result shows me:
   Web ID = txtReminder
   Web Element Type = TEXTAREA
   Web Value = Hello

Thanks!
1 REPLY 1

bruce.liu
Staff
Staff
Hi Kimmo,

It is not clear to me how this particular textarea node stores text in your case. All you had there is a JS function taking in a JSON string but it did not reveal how the string is being handled by the application.

I would advise to check the textarea HTML node after text "Hello" is displayed and then decide the best course of action. If word "Hello" cannot be found then look up the word in the entire HTML to see if you can locate the node containing the text. Often a web developer may not choose to implement the control in the way how it is designed. That is where the understanding of HTML will come in handy.