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

Trouble automating a RadAutoCompleteBox

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 05 Dec 2014, 10:14 PM
We've added a RadAutoCompleteBox to a control which handles email addresses and suggests those which have already been used.  I need to click in the box, and begin typing a few characters of a name, then verify the autocomplete suggested values are displaying what I want, and either continue typing or select a value.  The trouble I'm having is that once I get the automation to stop entering text, the control assumes that I'm done adding the value so it completes the entry and doesn't show me the suggested values.  This prevents me from accessing the items in the RadListBox/autocomplete results.

I've tried different flavors of this so far without any luck (using Test Studio 2014.1.410):

//Attempt 1
<RadAutoCompleteBox>.TypeText("Test");
<RadListBox>.Items[0].User.Click();
//At this point "Test" is typed into the box, but then focus is lost so the autocomplete box doesn't display, it just assumes "Test" is all that was needed to be entered and I get an error attempting to click the RadListBox

//Attempt 2
<RadAutoCompleteBox>.User.Click("Test");
SendKeys.SendWait("Test");
<RadListBox>.Items[0].User.Click();
//Same result as above, focus is lost after entering "Test" so the autocomplete box never opens and I get an error attempting to click the RadListBox

//Attempt 3
//Recorded Step: Click in the RadAutoCompleteBox
//Recorded Step: Type "Test" into the box
//Recorded Step: Select the first entry in the RadListBox
//These steps will click in the box, enter the text, but once again not recognize the RadListBox autocomplete results


Any other suggestions as to how I can approach this?  

Thanks,
Nick

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 10 Dec 2014, 06:19 PM
Hi Nick,

In Attempt 1 you state "but then focus is lost so the autocomplete box doesn't display". This sounds like maybe the click happened at the wrong coordinates. Can you verify the mouse is moving to the right coordinates before it clicks? If <RadListBox>.Items[0] gives us incorrect coordinates this problem can happen.

Attempt 2 sounds like it may be the same problem as attempt 1.

In attempt 3, is SimulateRealTyping checked for the Type "Test" into the box step? This is very important for autocomplete controls.

Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or