This is a migrated thread and some comments may be shown as answers.

TypeText not firing events for autosuggest

4 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wit
Top achievements
Rank 1
Wit asked on 26 Aug 2010, 10:19 AM
Here is sample test:
[Test]
        public void GoogleTest()
        {
            ActiveBrowser.NavigateTo("http://www.google.com");
            ActiveBrowser.WaitUntilReady();
             
            HtmlInputText queryBox = Find.ByName<HtmlInputText>("q");
            Desktop.Mouse.Click(MouseClickType.LeftClick, queryBox.GetRectangle());
            Desktop.KeyBoard.TypeText("sample", 1000);
             
            Actions.Click(Find.ById("btnG"));
        }

By watching its execution you'll notice that Google autosuggest is not visible during TypeText execution.
When typing manually autosuggest appears immediately.

Why TypeText works differently? How to force opening autosuggest?

4 Answers, 1 is accepted

Sort by
0
Wit
Top achievements
Rank 1
answered on 27 Aug 2010, 11:36 AM
I found some workaround for this:

Desktop.KeyBoard.TypeText(" ",0);
Desktop.KeyBoard.KeyPress(Keys.Back);

It appears that KeyPress works much better thna TypeText i.e. actual keystrokes are sent.
Why is TypeText not doing the same?
0
Konstantin Petkov
Telerik team
answered on 02 Sep 2010, 08:10 AM
Hello Wit,

Yes, I can confirm these methods behave in a different manner. The TypeText initiates KeyPress to the browser and KeyPress - KeyDown and Up events. The Google auto suggest definitely needs the KeyDown/Up to be triggered thus the behavior. I'm not sure why KeyPress itself doesn't make the auto suggest to popup for the Google search page though, this might be expected.

I'm logging a bug for investigation just in case. I can update this thread with our findings if needed.

Kind regards,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Accepted
Konstantin Petkov
Telerik team
answered on 14 Sep 2010, 01:01 PM
Hi Wit,

Good news here! I just verified the TypeText method has been improved in the latest build so that for example it now triggers the auto complete box on google.com. You can find the build available for download from the latest internal builds page in your account.

Your feedback is appreciated!

Kind regards,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Wit
Top achievements
Rank 1
answered on 14 Sep 2010, 02:20 PM
Cool!
Just installed the 2010.2.914.0 build and sample test now fires autosuggest.

Thank you for this fix. It's so good to see fixing going in so quickly :-)
Tags
General Discussions
Asked by
Wit
Top achievements
Rank 1
Answers by
Wit
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or