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

Unable to Find RadComboBoxItems

15 Answers 198 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kristine
Top achievements
Rank 2
Kristine asked on 07 Jul 2010, 12:27 PM
Hello,

The Silverlight application I am testing has 2 dependent radcomboboxes. e.g. combobox1 -> combobox2
The contents of combobox2 are dependent on the selected item in combobox1. My test sequence is a code-behind test and is like this

1. click combobox1 dropdown button
2. find all radcomboboxitems
3. select radcomboboxitem a
4. click combobox2 dropdown button
5. find all radcomboboxitems
6. select radcomboboxitem n

Step 2 and Step 4 are like this code:

SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
IList<Telerik.WebAii.Controls.Xaml.RadComboBoxItem> list = app.Find.AllByType<Telerik.WebAii.Controls.Xaml.RadComboBoxItem>();

Disabling steps 4-6, Step 2 is returning an EMPTY LIST.  Base on visual inspection, combobox1 has several items in the list, thus should NOT be EMPTY.

What I did was hard-code the selection of radcomboboxitem a (I manually added radcomboboxitem a in the project tree). My steps became like this:
1. click combobox1 dropdown button
2. radcomboboxitema.user.click()
3. click combobox2 dropdown button
4. find all radcomboboxitems
5. select radcomboboxitem n

What happened was Step 4 now returns the items in combobox1, which is a bit weird because by this time, base on visual inspection, combobox1 items are no longer visible. I am very confused why this is happening. Can somebody help me?

15 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 07 Jul 2010, 10:04 PM
Hello QA,

I suspect the important piece that you're missing is that our framework keeps a cached copy of the Silverlight VisualTree (the hierarchical representation of the UI) for performance reasons. If we didn't do this the performance would be unacceptably slow as we constantly try to interact with the live VisualTree contained with the browser.

As a result of this you need to sprinkle strategic calls to:

app.VisualTree.Refresh();

In your case what's happening is that, even though the dropdown is open and you can see items in your downdown list, our cached copy of the VisualTree is now out of sync with the live version in the browser. That's why your "app.Find.AllByType" isn't finding anything.

Greetings,
Cody
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
Kristine
Top achievements
Rank 2
answered on 08 Jul 2010, 04:34 AM
Hello Cody,

This is exactly what I was looking for. I believed I needed to do a refresh but I did not know the command. I even tried the ActiveBrowser.RefreshDomTree() method haha!

So this is how my code now looks like:
1. click combobox1 dropdown button
2. app.VisualTree.Refresh();
3. find all radcomboboxitems
4. select radcomboboxitem a
5. click combobox2 dropdown button
6. app.VisualTree.Refresh();
7. find all radcomboboxitems
8. select radcomboboxitem n

Step 3 now returns the correct items in combobox1. Step 7, on the other hand, returns all items in combobox2, plus the items in the combobox1. I do not understand why it still sees the items in combobox1 when I already did a visual refresh. I even tried adding up to 4 visual refreshes, also app.RefreshVisualTrees(), but still got the same result - it still sees the items in combobox1. Any idea how to resolve this?

Regards,
QA


0
Cody
Telerik team
answered on 08 Jul 2010, 04:55 PM
Hello QA,


Are the items in Combobox 1 actually being removed from the control? A common programming practice is to fill Combobox 2 based on the selection in Combobox 1 but the list of items in Combobox 1 to be left alone. In this scenario it is normal to get all the items for both Comboboxes using your "app.Find.AllByType" call. Remember even though a Combobox is not visually open showing items, the control still has items attached to it that simply aren't visible to the user in the UI.

Do you really want to use "app.Find.AllByType"? Would it be better to get just the list of items for a specific Combobox rather than everything?

Sincerely yours,
Cody
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
Kristine
Top achievements
Rank 2
answered on 09 Jul 2010, 03:00 AM
Hello Cody,

The items in the control are no longer visible in the UI. The main problem is, the two controls that I have mentioned are instances of a specialized radcombobox. Thus in the recording, whenever I highlight these controls, the tool is not able to recognize them as a radcombobox. Is there a way for me to make the tool recognize them as such?

Regards,
QA
0
Konstantin Petkov
Telerik team
answered on 09 Jul 2010, 11:27 AM
Hi,

The extended components should be automatically identified in WebUI Test Studio as the base controls.

Can you please share with us the exact RadControls for Silverlight version the application under test runs? It might be an incompatibility issue between latest RadControls Translators in WebUI Test Studio and an older RadControls release.

Best wishes,
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
Kristine
Top achievements
Rank 2
answered on 09 Jul 2010, 11:55 AM
Hi Konstantin,

I have coordinated with the dev team and they said the current build of the application uses Telerik Controls Q1SP2. They forwarded me a copy of the extension class but I can't post it here. I'll just post the class name declaration:

    public class WatermarkComboBox : Telerik.Windows.Controls.RadComboBox

Regards,
QA
0
Konstantin Petkov
Telerik team
answered on 12 Jul 2010, 02:28 PM
Hi QA,

I think I managed to reproduce the problem. Can you please confirm you're getting the same issue? Just take a look at the WatermarkComboBox element in the DOM Explorer and check it's base type. We should identify the RadComboBox there and instead we find the combo's base type -- Selector.

I forwarded this bug to our development team for investigation. We are almost done with the new 2010 Q2 release we will ship this week and once done we can jump to the next improvements in the product.

I can update this thread as soon as we have a solution for this issue and we have a build for you to give a try. Thank you for the feedback and please let us know if we could be of further help!

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
Kristine
Top achievements
Rank 2
answered on 13 Jul 2010, 04:59 AM
Hi Konstantin,

I'm sorry I'm not sure how to locate the element in the DOM explorer. What happens is whenever I highlight the watermarkcombobox in the recorder, the tool detects two separate elements: a textblock and a radtogglebutton.

Regards,
QA
0
Konstantin Petkov
Telerik team
answered on 13 Jul 2010, 09:37 AM
Hello QA,

Once you get the nub when you highlight the element and open its Element Menu just choose the second option for the DOM Explorer. You can find the Element Menu described in the QA Quick Start Guide on page 29. Turn to page 34 to get the DOM Explorer described as well.

Yes, I got the TextBlock and the ToggleButton as well during my testing so I assume we've both hit the same issue. I'll let you know when we have this problem fixed.

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
Konstantin Petkov
Telerik team
answered on 23 Jul 2010, 01:38 PM
Hello,

I'd like to point you to the latest build (labeled 2010.2.7.23 we just uploaded. You can get it from the LIB page in your account:

http://www.telerik.com/automated-testing-tools/account/downloads/internal-builds.aspx

The build resolves the problem you opened this thread for. It also includes some other important updates you can find listed here.

Sincerely yours,
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
Kristine
Top achievements
Rank 2
answered on 26 Jul 2010, 06:01 AM
Hi Konstantin,

Thanks for the update. I can't find the build labeled 2010.2.7.23 in my account though. Is it the 2010.2 713 (Jul 14, 2010) version instead?

Regards,
QA Tester
0
Konstantin Petkov
Telerik team
answered on 26 Jul 2010, 01:04 PM
Hello,

Once you download the official version from the middle of July the system will add the latest internal build (currently from July 23rd) to you account.

Please let us know if you have other questions.

All the best,
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
Kristine
Top achievements
Rank 2
answered on 27 Jul 2010, 07:20 AM
Hi Konstantin,

Thanks for the clarification. I have downloaded and installed the said latest internal build 2010.2.7.23. However, I have encountered an error when I tried to execute my existing tests using this version. The step that fails involves maximizing a RadWindow. This step is passing in the previous version. The failure information is as below:

--------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
The control type 'ArtOfTest.WebAii.Silverlight.UI.Button' does not match the xaml tag 'radbutton'
InnerException:
System.ArgumentException: The control type 'ArtOfTest.WebAii.Silverlight.UI.Button' does not match the xaml tag 'radbutton'
   at ArtOfTest.WebAii.Silverlight.FrameworkElement.As[T]()
   at ArtOfTest.WebAii.Silverlight.VisualFind.InternalAs[T](FrameworkElement element)
   at Telerik.WebAii.Controls.Xaml.RadWindow.ButtonClick(String buttonName)
   at Telerik.WebAii.Controls.Xaml.RadWindow.Maximize()
   at Telerik.WebAii.Design.Translators.Xaml.Window.WindowButtonClickAction.Execute(SilverlightApp autoHost)
   at ArtOfTest.WebAii.Design.Extensibility.XamlActionDescriptor.Execute(IAutomationHost autoHost)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep()

I tried to rerecord this step in the hopes that I just need to update the Find Logic of the RadWindow. However, in the new recording, all project elements are now added to a new SilverlightApp instance. Please see attached screenshot of the Elements explorer. The failing step is Step 9. Do you have any remedy for this error?

Regards,
QA
0
Accepted
Konstantin Petkov
Telerik team
answered on 27 Jul 2010, 11:30 AM
Hi QA,

We have addressed the error you posted and uploaded a new build. You should no longer get this error on test execution after installing. I suppose a recent update of RadControls may have introduced that and the RadWindow translator just needed a quick update.

Please uninstall the previous build and install the new one available at the internal builds page. It is labeled as 2010.2.727 and the list of updates is available here.

Please let us know if you experience any other issues and sorry for the inconvenience!

All the best,
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
Kristine
Top achievements
Rank 2
answered on 28 Jul 2010, 07:53 AM
Hi Konstantin,

Thanks for the update. The RadWindow error is now fixed with the new internal release. The tool is now also able to detect the extended components of the Telerik controls, e.g. WatermarkComboBox as RadComboBox. It, however, creates a new instance of the SilverlightApp named SilverlightApp_0, and then places all newly-added elements in this instance. It's still able to recognize the elements in the first SilverlightApp instance though, so I'll leave it as it is.

I'll mark this thread answered. Thanks so much!

Regards,
QA
Tags
General Discussions
Asked by
Kristine
Top achievements
Rank 2
Answers by
Cody
Telerik team
Kristine
Top achievements
Rank 2
Konstantin Petkov
Telerik team
Share this question
or