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

Data Driven Testing for Combo Box

3 Answers 133 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jan Mark P.
Top achievements
Rank 1
Jan Mark P. asked on 20 Dec 2010, 03:30 PM
Hi,

This is similar to Data Driven Testing - Combo Boxes, I tried the similar approach but I got the following error:

" (CS0030) Cannot convert type 'Telerik.WebAii.Controls.Xaml.RadComboBoxItem' to 'ArtOfTest.WebAii.Silverlight.UI.ComboBoxItem'"

I would like to ask what approach shall I use to fix the error I am getting.

Or are there other alternative how I can use the Data Driven approach when selecting combo box since the combo box that I will be used for testing is very dynamic.

Thank you

3 Answers, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 20 Dec 2010, 03:50 PM
Hello Jan Mark P.,

 You should change the item type in the foreach loop:
From:

foreach (ComboBoxItem cboxItem in Pages.Pale2.SilverlightApp.Item0Combobox.Items)

to:
foreach (Telerik.WebAii.Controls.Xaml.RadComboBoxItem cboxItem in ...

Hope this helps.

Greetings,
Nikolai
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Jan Mark P.
Top achievements
Rank 1
answered on 20 Dec 2010, 04:43 PM
This works fine now.

But I got the following error during execution:

Exception thrown executing coded step: '[Test_CodedStep] : New Coded Step'.InnerException:System.TimeoutException: Wait for condition has timed out at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo) at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout) at ArtOfTest.WebAii.Silverlight.VisualWait.ForExistsInternal(Int32 timeout, Boolean invertCondition) at ArtOfTest.WebAii.Silverlight.VisualWait.ForVisible(Int32 timeout) at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get(XamlFindExpression expr, Boolean waitOnElement, Int32 timeout) at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get(XamlFindExpression expr) at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get[TControl](XamlFindExpression expr) at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get[TControl](String[] clauses)

It seems that it cannot find the string I was looking for.

The format of the combobox is a bit complicated though (Company Code - Company Code, e.g. "AA - Company AA"). I tried using "AA", "Company AA" and even "AA - Company AA" in Local Data but same error was found. If I were not to do it as data driven, it would only click on "AA".

Regards,
Jan Mark

0
Nikolai
Telerik team
answered on 21 Dec 2010, 06:28 AM
Hi Jan Mark P.,

I think this problem is related to the "Virtualization" of the RadComboBox's items. The problem here is that the Items collection contains only the currently visible items as they are part of the Silverlight's VisualTree.
In order to overcome this you will need to do is some scrolling and make sure that the item you are looking for is visible in the drop down. 

Another thing you can check is the string comparison. The code that you are using is doing a "Absolute" match so if you have some empty spaces the comparison will fail. You can add some log steps and annotate the items content and data driven strings currently used in the loop.


Kind regards,
Nikolai
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Jan Mark P.
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
Jan Mark P.
Top achievements
Rank 1
Share this question
or