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

How to find and select an RadComboBox item

8 Answers 270 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Svetlana
Top achievements
Rank 1
Svetlana asked on 10 Jun 2010, 12:05 PM
Hello,

I need to select an item in RadComboBox. The items may have different values on each test running. So I need to select second item and get item's text to verify it later.

Example:
<div style="display: block; visibility: visible; top: 0px; left: 0px; width: 256px;"
    class="RadComboBoxDropDown RadComboBoxDropDown_Office2007 " id="ctrlGroupSelector_comboGroup_DropDown">
    <div style="width: 100%; overflow: auto; height: 102px;" class="rcbScroll rcbWidth">
        <ul style="list-style: none outside none; margin: 0pt; padding: 0pt;" class="rcbList">
            <li class="rcbItem "></li>
            <li class="rcbItem ">firstRow</li>
            <li class="rcbItem ">secondRow</li>
            <li class="rcbItem ">ThirdRow</li>
            <li class="rcbHovered ">Test</li></ul>
    </div>
</div>

Could you, please, give an example how to find and select second item?

Thanks,
Svetlana



8 Answers, 1 is accepted

Sort by
0
Missing User
answered on 10 Jun 2010, 08:18 PM
Hello Svetlana,

Thanks for the post and html code. 

It  would be convenient to be able change how the an item is selected from Value to an Index, but you would currently need to use some customized code. I'll log a feature request to be able to do this more easily.

I was able to get this scenario working with a couple lines of code based on this demo page. Please record a similar sequence for your page:

1) Click to Open RadComboBox
2) Highlight and add a Wait for test step on the item count in the RadComboBox. It would look like the following for the demo page: 'RadComboBox (Wait For): item count 'Equals' '91'
3) Add custom code similar to below for your page (the code is based on the demo page):

Pages.ASPNETComboBoxDemo.RadComboBox1Div.Items[1].Select();
String Text = Pages.ASPNETComboBoxDemo.RadComboBox1Div.Text;

String Text is the selected item text and you can use it later on in your test.. Please let me know if you have any questions on this.

Kind regards,
Nelson Sin
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
Missing User
answered on 17 Jun 2010, 04:38 PM
Hi again Svetlana,

Just wanted to check back and see if you were able to apply this successfully to you test project.

Kind regards,
Nelson
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
Olena
Top achievements
Rank 1
answered on 26 May 2011, 04:13 PM
Hi Nelson

I have a similar problem. I have a dynamically updated combobox and Select by index does not really work for me.
I tried "Select by text" but it fails. I also added a regular wait after expanding the combobox list to let it load, but no luck.

Could you please advise what else can I try?

Thanks in advance
Helen
0
Cody
Telerik team
answered on 26 May 2011, 06:25 PM
Hello Olena,

What happens when you do try "Select by text"? What error do you run into? I am trying to understand why "Select by text" isn't working for your as expected. Can you record a video of this problem and send it to us for analysis? Jing is a good free screen recorder.

All the best,
Cody
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
Olena
Top achievements
Rank 1
answered on 26 May 2011, 07:33 PM
Hi Cody

I attached the video with the log shown.
Please let me know if you need any clarifications.

Thanks in advance
Helen
0
Cody
Telerik team
answered on 31 May 2011, 10:13 PM
Hi Olena,

Thank you for the video demonstrating the failure. At a quick glance this does appear like a bug. For us to isolate it and fix it we need to be able to reproduce this problem locally. Is there anyway for us to access your test application directly? Or could you show us what the VisualTree looks like for that combobox? Attached is a sample of how a standard Silverlight Combobox looks in our DOM Explorer. Does yours have a similar structure?

Regards,
Cody
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
Olena
Top achievements
Rank 1
answered on 14 Jun 2011, 04:16 PM
Hi Cody

I'm sorry for such a delay with answer.
I can send you the connection details - I'm almost sure that we have provided your team with access to our system in past, so I think it shouldn't be a problem now.
Is your last name Gibson?

Once you confirm I'll send you the instructions and credentials

Best wishes
0
Cody
Telerik team
answered on 20 Jun 2011, 07:39 PM
Hi Olena,

I just returned from vacation, so I am sorry for the delay getting back to you as well. yes, it is Cody Gibson. I look forward to receiving the credentials. Though I do recommend opening a support ticket and sending them there. This is a public forum the entire world can read. Support tickets can only be ready by you and my support team.

Kind regards,
Cody
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!
Tags
General Discussions
Asked by
Svetlana
Top achievements
Rank 1
Answers by
Missing User
Olena
Top achievements
Rank 1
Cody
Telerik team
Share this question
or