IE10 preview on Windows 7 and PressKeys on a TextArea issue

Ask general questions here.
User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

IE10 preview on Windows 7 and PressKeys on a TextArea issue

Post by Aracknid » Fri Jan 25, 2013 10:42 pm

I'm using Windows 7 with the preview version of IE10. So far it is basically working, however I have run into a small issue and I'm not sure if it's an IE10 issue or just an odd behaviour (it is working fine in IE9).

I have a TextArea in my browser, and in my code, the variable "MyTextArea" is correctly assigned. When I try to type in a string that is a full sentence, only the first word is typed in and the rest is not. But if I try a second time it works fine. I cannot say for sure, but it might also be because this browser window with the textarea object was just opened and this is the first thing I'm trying to type into it.

Here is my code and what I did to work around it (note that almost always the if condition is triggered)... perhaps if this is a bug you can look into it.
MyTextArea.UseEnsureVisible = True
MyTextArea.PressKeys("{CONTROL DOWN}{END}{CONTROL UP}{SHIFT DOWN}{CONTROL DOWN}{HOME}{CONTROL UP}{SHIFT UP}{DELETE}")
MyTextArea.PressKeys(sValuePassedIn)

'And to fix it I just did this, which solves the problem....
If MyTextArea.InnerText <> sValuePassedIn Then
    MyTextArea.UseEnsureVisible = True
    MyTextArea.PressKeys("{CONTROL DOWN}{END}{CONTROL UP}{SHIFT DOWN}{CONTROL DOWN}{HOME}{CONTROL UP}{SHIFT UP}{DELETE}")
    MyTextArea.PressKeys(sValuePassedIn)
End If
Aracknid

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: IE10 preview on Windows 7 and PressKeys on a TextArea issue

Post by Ciege » Fri Jan 25, 2013 11:09 pm

I am curious if this may be an issue with the browser not being full loaded before you start interacting with it.
Can you try adding a check for the DOM's readystate to be complete before trying to enter your text?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: IE10 preview on Windows 7 and PressKeys on a TextArea issue

Post by Aracknid » Fri Jan 25, 2013 11:35 pm

Oh, it's ready. Trust me. :lol:

Seriously though, I already have all that in place in my framework. Actually, prior to trying to type in, it is doing a bunch of other checks, such as making sure the text displaye at the top of the dialog is the correct text (the title of the 'thing' I'm editing, but not the title bar title...) and it's also validating the text that is already in the TextArea that I'm about to replace is correct from a previous go at entering text in it and saving it.

Not to throw this off, but I noticed that IE10 now does spell checking on Text Areas by default, and I wondered if this might have an affect on it. See this: http://ie.microsoft.com/testdrive/Brows ... fault.html

I should mention I'm using Ranorex 3.3.5.

Aracknid.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: IE10 preview on Windows 7 and PressKeys on a TextArea issue

Post by Ciege » Fri Jan 25, 2013 11:46 pm

Aracknid wrote:Oh, it's ready. Trust me. :lol:
Heh... Ah well... Just a thought...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...