Pages.AppPage.SLApp.RadCombobox.User.Click();
this action is not working always mean it is not opening Item list so my next Item selection step is failing.
any solution to this issue?
thanks in advance.
I am using latest trial version.
11 Answers, 1 is accepted
As part of the WebUI Test Studio installation you can find some samples projects that contain either a set of recorded tests with the RadControls Translators as well as a project with coded tests you may want to take a look. That applies to both the ASP.NET and Silverlight translators. You may also check the API of those wrappers of RadControls through the .chm API reference coming on installing the product as well.
Please find below a sample test code that operates against the RadComboBox for Silverlight by means of opening and selecting an item as well as performs some verifications for completeness:
combo.ToggleDropDown();Assert.IsTrue(combo.IsDropDownOpen, "Combo drop down open after toggle drop down call verification failed!");Assert.AreEqual<int>(12, combo.Items.Count, "Combo item count after drop down open call verification failed!");Assert.IsTrue(combo.Items[0].IsSelected, "Combo item selected after drop down open call verification failed!");Assert.AreEqual<string>("Alapattah", combo.Items[0].Text, "Selected item text initial verification failed!");combo.SelectItem(3, false);Assert.IsFalse(combo.IsDropDownOpen, "Combo drop down open after item selection verification failed!");Assert.AreEqual<string>("El Portal", combo.Text, "Combo text after item selection verification failed!");Assert.AreEqual<int>(3, combo.SelectedIndex, "Combo selected index after item selection verification failed!");That test runs against the live demo here.
I hope that helps!
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks for your quick reply.
Problem I am having is for is normal SIlverlight Combo Box not RadComboBox as I mentioned in original post. so I am not able to use SelectItem, ToggleDropdown methods.
Pages.AppPage.SLApp.Combobox.User.Click();
this action is not working always mean it is not opening Item list so my next Item selection step is failing.
any thoughts.
Thanks,
Mukul
Just to add a bit to the conversation-
A couple of quick questions: Is your control a custom control that inherits from SIlverlight Combo Box? And did the click work consistently before converting to code?
Also, please keep in mind that the mouse click actually moves the mouse cursor to click on the Silverlight control. So the desktop muct be active (not locked or in screen saver modes) and the test playback browser must be active and have focus.
Best wishes,
Nelson Sin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
-[Muku] It is standard Silverlight Combobox. Before converting to code also it was not working consistenlty. It fails most of the times.
Also, please keep in mind that the mouse click actually moves the mouse cursor to click on the Silverlight control. So the desktop muct be active (not locked or in screen saver modes) and the test playback browser must be active and have focus.
-[Mukul] Desktop / Browser is active.
Thanks,
Mukul
Is your Silverlight app embedded in an html page with an object tag or in an IFrame? Also, are there multiple Silverlight apps on the page? And is the Silverlight app in a Pop Up Window?
And please try re-recording the mouse click test step on the Combobox with the 'UseOffset' Property to true. Also try adjusting the 'ClickPoint' property and it's subproperties (ClickUnitType, OffSetRefernce, X, Y) to better zero in on the Combbox.
Regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
[Mukul] Silverlight app in an html page with an object tag. There is only one Silverlight App on the page and it's not a pop up window.
And please try re-recording the mouse click test step on the Combobox with the 'UseOffset' Property to true. Also try adjusting the 'ClickPoint' property and it's subproperties (ClickUnitType, OffSetRefernce, X, Y) to better zero in on the Combbox.
[Mukul] I am not sure how to set "UseOffset" property for recording. can you please guide me.
So when you click on a generic Silverlight element, in this case a CombpBox, the click test step has properties you can view in the Visual Studio Properties Window if you right click on the step and select 'Properties' in the context menu.
In the Properties Window, there is a 'ClickPoint' property you can set to true/false. From the code you posted, it looks like it was set to off.
There is also a 'ClickPoint' node you can expand and adjust it's properties to help WebUI click on the element better on test playback
Regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Please see the attached snapshot file?
I'm attaching a test for reference that simulates testing over generic ComboBoxes.
Please note the test sequence and that the click properties ( 'UseOffset' property and 'ClickPoint' node) I mentioned were for clicking on the drop down arrow before clicking on the items themselves.
Pleae post back if you have any questions on the test or anything ese with the testing scenario.
Kind regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I am using the same approch but still it's not working most of the times. I observed following when it's not working:
My steps are as follows:
1)Open application home page
2)Click on Menuitem which loads new page
3)Click on combobox and select required item.
when its not working I found mouse click on combobox but it opens the menu item in step 2 not the combobox
is it because the silverlightapp is not fully loaded? I tried ActiveBrowser.WaitUntilReady() before clicking on combobox but it doesn't have any effect
Thanks for the extra information. Can you try converting step 2 to code, then after the code that is generated, please insert the following line that will look something like this:
[CodedStep(@"Click on Menuitem", RequiresSilverlight = true)] public void WebAiiTest2_CodedStep() { //insert this line after generated code ActiveBrowser.SilverlightApps()[0].VisualTree.Refresh(); }Also, if the above does not work, would it be possible to grant us access to your site? We can sign any non-disclosure documentation as necessary.
Regards,
Nelson
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.