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

Wait for combo box to populate

10 Answers 295 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 03 May 2011, 07:27 AM
Our application has combo boxes which populate with data only after another combo box has a selection - the contents of the second combo box are dependent on the value selected in the first combo box.

This means that after I make a selection in ComboBoxA, there is a delay for ComboBoxB to populate, before it is available for selection. How do I get the test to wait until ComboBoxBis populated? I do not want a generic wait for a fixed period of time - I want the test specifically to wait until the combo box is populated (at the moment, it's trying to open the drop-down before there is data present).

Thanks,
Simon

10 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 03 May 2011, 11:30 PM
Hello Simon,

I had success at accomplishing this by creating a custom Verification and converting it to a Wait:

1. Right click the step that sets ComboBoxA and select "Run To Here."
2. Enable hover over highlighting and hover over ComboBoxB.
3. Click the blue nub and choose "Build Verification."
4. Click the "Content" button from the Available Verifications.
5. The Selected Sentence should be good as is. Click the "Validate rule" icon on the far left of the sentence to confirm (mine read InnerText, Exact, Please select option A, B, C).
6. Close the browser to stop recording.
7. Right click this newly created Verify step and choose "Change Role"->"Set As Wait."

Regards,
Anthony
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Simon
Top achievements
Rank 1
answered on 05 May 2011, 03:30 AM
Anthony,

At Step 3, I get THREE blue nubs to choose from (as per screenshot "Combo1" attached): one for a rectangle, one for a toggle button, one for a combo box. No matter which one of these three nubs I choose, I do not get "Content" as one of the Available Verifications. I've attached a screenshot of what I get when I choose the combobox nub ("Combo2").

I have been experimenting a lot while I try to get this to work - if I'd seen any option anywhere for "Content", I would have tried it as a logical choice.

Simon

P.S. The "Attach file" function isn't working for me. Sorry.
0
Anthony
Telerik team
answered on 05 May 2011, 05:42 PM
Hello Simon,

My apologies for giving you advice based on HTML. Sounds like you are testing a Silverlight application. There a few gradually more complicated steps you can take.

At Step 3, choose RadComboBox and then ComboBox Number from the Available Verifications. You could change your selected sentence to "item count, greater than, 1." Then change that Verify to a Wait. So, Test Studio will wait for ComboBoxB to have more than one item in it before making a selection. This should mean the data is loaded to choose from.

You may need to add a "while...loop" from the Logical ribbon. The While's verification will be that item count equals 0, or perhaps that one of the textblock contents is not visible. Copy the step that clicks on ComboBoxB twice and drag both so they are nested in the loop. So, while the item count is 0, Test Studio will close and reopen the drop down, waiting for the data to refresh.

Regards,
Anthony
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Simon
Top achievements
Rank 1
answered on 09 May 2011, 03:00 AM
I don't get "item count" as an available verification for the combobox. Actually, the sentence for the combobox is not editable - it shows only "selected item is -1", and I can not change this. Refer attached screenshot (which works now).
0
Simon
Top achievements
Rank 1
answered on 12 May 2011, 03:26 AM
Hello? Can someone help me with this please?

Please refer to my reply on 8 May... (above)

Thank you.
0
Boyan
Telerik team
answered on 12 May 2011, 09:23 AM
Hello Simon,

You are using an older version of WebUI Test Studio which doesn't have this verification. I have attached a screenshot how this screen looks in the latest version. You can either download the latest version of WebUI Test Studio which was released on the 2nd of May or use a coded step. Here is what the code should look like:
Wait.For<Telerik.WebAii.Controls.Xaml.RadComboBox>((a_) => ArtOfTest.Common.CompareUtils.NumberCompare(a_.Items.Count, 1, ArtOfTest.Common.NumberCompareType.GreaterThan), Pages.Combo.SilverlightApp.Combo1Radcombobox, false, 10000);
Where "Pages.Combo.SilverlightApp.Combo1Radcombobox" is the specific RadComboBox element you wish to check. This step waits for the RadComboBox to have more than 1 item.


Best wishes,
Boyan
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Simon
Top achievements
Rank 1
answered on 13 May 2011, 02:13 AM
Thank you again.

I have downloaded the latest version of WebUI Test Studio - thank you for making me aware of this.

However, the problem still exists.

I note that your screenshot identifies the target element as a RadComboBox. We are using a ComboBox (as per my previous screenshot). Please provide the correct information for a ComboBox - how do I get the test step to wait until the ComboBox is populated with data?



0
Anthony
Telerik team
answered on 17 May 2011, 05:19 PM
Hello Simon,

Here is the correct coded step for a regular ComboBox. This will wait for the ComboBox items to be more than 1.


Wait.For<ArtOfTest.WebAii.Silverlight.UI.ComboBox>((a_) => ArtOfTest.Common.CompareUtils.NumberCompare(a_.Items.Count, 1, ArtOfTest.Common.NumberCompareType.GreaterThan), Pages.SilverlightApplication1.SilverlightApp.Combo1Combobox, false, 10000);


Best wishes,
Anthony
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Simon
Top achievements
Rank 1
answered on 18 May 2011, 07:30 AM
I've changed the code for this step to be as follows:

'Wait for item count of CompanyComboBoxCombobox to be 1 or more
Wait.For(Of ArtOfTest.WebAii.Silverlight.UI.ComboBox)(Function(a_) ArtOfTest.Common.CompareUtils.NumberCompare(a_.Items.Count, 1, ArtOfTest.Common.NumberCompareType.GreaterThanOrEqual), Pages.Home1.SilverlightApp.CompanyComboBoxCombobox, false, 10000)

It's not EXACTLY the same as your suggestion, but I've stayed within the format that was provided by Web Studio, and changed only the bits relating to checking for Items.Count. Note also that  I've opted for greater than or equal to 1, rather than greater than 1.

However, it doesn't work.

Could you please help me further?
0
Anthony
Telerik team
answered on 20 May 2011, 05:18 PM
Hello Simon,

Can you be more specific as to what doesn't work? If there is a failure at a specific step, please double click the red and white "X" icon next to it and provide us the failure details.

Is it possible the 10 second wait we provided in the sample code is not long enough? If so, please try increasing that value. Is the ComboBox in a ChildWindow? We are aware of an issue where this could cause a problem.

Is it possible to grant us access to your application to test directly? If not, then perhaps a sample or small portion of it that demonstrates the behavior.

Regards,
Anthony
the Telerik team
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Simon
Top achievements
Rank 1
Boyan
Telerik team
Share this question
or