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

[Solved] Extended Silverlight RadControls

6 Answers 36 Views
Telerik Testing Framework
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Larah Chris
Top achievements
Rank 1
Larah Chris asked on 18 Jun 2010, 01:33 PM
Hi Team,

 According to the telerik blogs here, the WebAii Testing Framework support extended silverlight RadControls.
 So in the silverlight side, I extended the RadWindow Control, it's seems something like this :
using Telerik.Windows.Controls;  
public class STWindow : RadWindow  
{   
    ....  

I use it in the xaml file:
<extended:STWindow x:Name="Alert" ../> 

Then, in the testing side, I override the RadWindow control mappings like this :
private void RegisterExtendedFrameworkElement()  
{            
  MappingsCollection STWindow = new MappingsCollection();  
  STWindow.Add(RadControlMappingKeys.WindowKey, "STWindow");  
  Manager.RegisterMappingsOverride(STWindow, typeof(RadWindow));  

Finally, in the test method I want to locate my extended RadWindow so I do this :
[TestMethod]  
public void RadWindowTest()  

  //click on the button who open the STWindow 
  RadWindow stwindowRad app.Find.ByType<RadWindow>();
  ...

So the stwindowRad is null

could I forget to do something?

thanks in advance
Larah

6 Answers, 1 is accepted

Sort by
0
Missing User
answered on 22 Jun 2010, 01:17 AM
Hi Larah,

Thanks for the post, we're looking at the problem and will get back to you with anything we find.

Greetings,
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
Missing User
answered on 30 Jul 2010, 08:00 PM
Hi again Larah,

I apologize for the very late reply, I missed the notice to suggest the latest WebUI Build here to try to address this problem. I'm also opening this issue up to the forums just in case anyone else may run into this problem.

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
Karthik
Top achievements
Rank 1
answered on 02 May 2012, 06:34 AM
Hi,

I am using the WebAii test framework for the first time and I am trying the approach mentioned above. I am getting an exception. Part of the message is as shown below:

....  System.NullReferenceException : Object reference not set to an instance of an object.
    at Telerik.WebAii.Controls.Xaml.RadComboBox.ToggleDropDown()
    at Telerik.WebAii.Controls.Xaml.RadComboBox.SelectItem(String itemText, Boolean openDropDown)


I am trying to select an item from a custom Telerik.Window.Controls.RadComboBox using WebAii wrappers. The Testing Framework version I am using is 2011.2.1117.0.

Any help is appreciated.

Thanks.
0
Anthony
Telerik team
answered on 03 May 2012, 06:25 PM
Hello Karthik,

The following code worked for me against this Telerik demo site:

SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
Telerik.WebAii.Controls.Xaml.RadComboBox cb = app.Find.ByAutomationId<Telerik.WebAii.Controls.Xaml.RadComboBox>("TechnologySelection");
Assert.IsNotNull(cb);
 
cb.SelectItem("Silverlight", true);

If you prefer Visual Basic, use our code converter.

Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Karthik
Top achievements
Rank 1
answered on 03 May 2012, 07:12 PM
Thanks for the response.

The code you suggested above works if the silverlight app uses RadComboBox and I try to access it using the method you suggested.

However, I was describing a scenario where I have a custom combo box say AlphaComboBox which extends RadComboBox that I am using in a silverlight application. If I wanted to find this thru WebAii wrappers for testing, how would I do this? I tried the approach that was suggested above by Larah, and I got the exception I posted above.


Thanks.
0
Anthony
Telerik team
answered on 03 May 2012, 10:28 PM
Hello Karthik,

I found the new location of the blog post mentioned in the original posting. If you follow the approach outlined there and continue to have difficulty, please provide a code sample that demonstrates the issue, preferably against a public site so we can test it directly.

All the best,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
Telerik Testing Framework
Asked by
Larah Chris
Top achievements
Rank 1
Answers by
Missing User
Karthik
Top achievements
Rank 1
Anthony
Telerik team
Share this question
or