difference in using KeyPress and Innertext for TextAreaTag

Ask general questions here.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

difference in using KeyPress and Innertext for TextAreaTag

Post by c676228 » Thu May 21, 2015 5:30 pm

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,

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: difference in using KeyPress and Innertext for TextAreaTag

Post by c676228 » Thu May 21, 2015 6:51 pm

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

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: difference in using KeyPress and Innertext for TextAreaTag

Post by krstcs » Thu May 21, 2015 7:26 pm

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.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: difference in using KeyPress and Innertext for TextAreaTag

Post by c676228 » Thu May 21, 2015 8:41 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: difference in using KeyPress and Innertext for TextAreaTag

Post by krstcs » Thu May 21, 2015 8:56 pm

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
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: difference in using KeyPress and Innertext for TextAreaTag

Post by c676228 » Sat May 23, 2015 12:18 am

thanks for your comment. :D