- radComboBox.SelectItem("Wisconsin");
- System.InvalidOperationException: Point (2220, 1624) outside bounds of browser window: (1797, 194, 1073, 717)
- ArtOfTest.WebAii.Silverlight.UserInteraction.ValidateMouseLocationIfNeeded(Point point)
- ArtOfTest.WebAii.Silverlight.UserInteraction.Click(MouseClickType clickType, Point offsetPoint, OffsetReference reference)
- Telerik.WebAii.Controls.Xaml.RadComboBox.SelectItem(String itemText, Boolean openDropDown)
- Telerik.WebAii.Controls.Xaml.RadComboBox.SelectItem(String itemText)
- <my call to SelectItem>
Joel
7 Answers, 1 is accepted
I am going to guess that at the time it is trying to select the item, it's not current visible on the screen, correct? Can you try adding some code to scroll the list until the item you want to select is visible before selecting it?
All the best,Cody
You are correct. After digging around a little, I found that this little piece of code fixes my problem. It finds the RadComboBoxItem I want to select based on selectionArg, calls EnsureClickable on that item and then selects it.
RadComboBoxItem item = radComboBox.Items.FirstOrDefault(x => x.Text.Equals(selectionArg));
item.EnsureClickable();
item.Select();
Thanks.
Joel
That is great news! I very much appreciate the update letting us know exactly how you resolved this problem. As a result of this we are going to look into adding EnsureClickable to the Select function so our other customers don't run into the same problem. In fact I've granted you 800 Telerik points for pointing out to us such an excellent find.
Thank you,Cody
Are you using Test Studio and creating a Test Studio type test or are you using the Telerik Testing Framework and manually creating a 100% coded unit test? If you're using Test Studio you want to add a coded step right after opening the drop down of the combobox. Then add this code into the coded step.
All the best,Cody
the Telerik team
Test Studio Trainings
RadComboBox radComboBox = Pages.SapiensDecision1.SilverlightApp.AnimatedCommonOuterBorderBorder;
RadComboBoxItem item = radComboBox.Items.FirstOrDefault(x => x.Text.Equals(
"Name"
));
item.EnsureClickable();
item.Select();
and run into this errors:
d:\work\qa\DECISION QA\Actions\Fact Type\New FT tab.tstest.cs: Line 103: (CS0104) 'RadComboBox' is an ambiguous reference between 'Telerik.WebAii.Controls.Html.RadComboBox' and 'Telerik.WebAii.Controls.Xaml.RadComboBox'
d:\work\qa\DECISION QA\Actions\Fact Type\New FT tab.tstest.cs: Line 103: (CS0029) Cannot implicitly convert type 'ArtOfTest.WebAii.Silverlight.UI.Border' to 'Telerik.WebAii.Controls.Html.RadComboBox'
d:\work\qa\DECISION QA\Actions\Fact Type\New FT tab.tstest.cs: Line 104: (CS0104) 'RadComboBoxItem' is an ambiguous reference between 'Telerik.WebAii.Controls.Html.RadComboBoxItem' and 'Telerik.WebAii.Controls.Xaml.RadComboBoxItem'
d:\work\qa\DECISION QA\Actions\Fact Type\New FT tab.tstest.cs: Line 105: (CS1061) 'Telerik.WebAii.Controls.Html.RadComboBoxItem' does not contain a definition for 'EnsureClickable' and no extension method 'EnsureClickable' accepting a first argument of type 'Telerik.WebAii.Controls.Html.RadComboBoxItem' could be found (are you missing a using directive or an assembly reference?)
d:\work\qa\DECISION QA\Actions\RFV\navigation tree.tstest.cs: Line 82: (CS0618) 'Telerik.WebAii.Controls.Xaml.RadTreeView.AllNodes' is obsolete: 'The property is deprecated. Please use AllNodesElements instead.'
To correctly solve this problem it's important to know what type of application you're testing either Silverlight or HTML. I can tell from your code sample your application is Silverlight. In this case you need to remove this line of code from your code file:
using Telerik.WebAii.Controls.Html;
If you cannot see this line of code then click the View Class button. This will solve the errors for lines 103, 104, and 105.
For line 82 simply replace "AllNodes" with "AllNodesElements" and now you should be all fixed.
Let me know if you run into further problems and need more assistance.
Cody
Telerik
Test Studio Trainings