Page 1 of 1

difference in using KeyPress and Innertext for TextAreaTag

Posted: Thu May 21, 2015 5:30 pm
by c676228
Hi,

I noticed an interesting issue.
In data driven testing, UserDescriptionTxt is a TextAreaTag which I need to set text from different languages.
When the row data is all English, the value set via UserDescriptionTxt.PressKeys(varUserDescription) has no issue.
When there are multiple languages, I have to use the following statement. The value has been set based on the data from data source in different languages. However, data from each row will overwrite the previous row in each iteration.
UserDescriptionTxt.InnerText= varUserDescription. I also tried TagValue. same issue.

any idea?

Thanks,

Re: difference in using KeyPress and Innertext for TextAreaTag

Posted: Thu May 21, 2015 6:51 pm
by c676228
Actually it doesn't matter what language it is. If UserDescriptionTxt.InnerText= varUserDescription is used to set value of TextAreaTag, the last row user description text will replace all the row data entered during the previous iterations.

I am wondering if there is any other method to set TextAreaTag value without using PressKeys since we will have mix languages for the fields.

Thanks,
Betty

Re: difference in using KeyPress and Innertext for TextAreaTag

Posted: Thu May 21, 2015 7:26 pm
by krstcs
Betty, why is PressKeys() not working for you with multiple languages? It should handle UNICODE just fine.

Also, you might try using Keyboard.Press() instead of Adapter.PressKeys(). You would need to set focus to the text area first, but it should work with UNICODE as well.

Re: difference in using KeyPress and Innertext for TextAreaTag

Posted: Thu May 21, 2015 8:41 pm
by c676228
Yes, krstcs, you are right. I just tried. it works perfectly fine. I thought it won't handle unicode.
The data for each row sets correctly. :D

However, using TagValue and Innertex seems not working. Bug?

Thanks so much.

Re: difference in using KeyPress and Innertext for TextAreaTag

Posted: Thu May 21, 2015 8:56 pm
by krstcs
Without seeing the code you were using I wouldn't be able to tell you if it was a bug or if you just missed something. I've never had a problem like you described, but I try to stick with the standard methods of input so there is less for me to worry about. I've not found an instance where I really needed to use anything else, but I only test on standard HTML and Java applications at the moment.

But if PressKeys() works for you then we don't have to worry about the other. :D

Re: difference in using KeyPress and Innertext for TextAreaTag

Posted: Sat May 23, 2015 12:18 am
by c676228
thanks for your comment. :D