Wonder if anyone can help. Im trying to automate a number of navigation tests for a silver light website. One of my tests clicks on a button which in turn opens a radWindow popup with a number of other controls on it. the problem is I can not get any details of the objects on the newly opened radWinow. If I try to all the controls to a list my code is returning the objects of the silverlight webpage in the back ground. The newly opened radWindow popup does not have a url so I can not activate/shift focus to it. Can anyone shed any light on this problem please?
Below is a copy of my code if this helps:-
//List of buttons on orignal Silver Light Web page
var buttons = _silverlightApp.Find.AllByType<TextBlock>();
System.Drawing.Point point = new System.Drawing.Point();
point.X = 350;
point.Y = 280;
//Open radWindow popup
buttons[1].User.ClickPoint(point);
//Wait for radWindow popup to open
Thread.Sleep(10000);
//Try to get a list of all the objects on the new radWindow
var buttons1 = _silverlightApp.Find.AllByType<TextBlock>();
I work for Telerik in the Test Studio and Telerik Testing Framework support group. I will try to assist you with this problem.
I think your problem is caused by not refreshing the frameworks copy of the Silverlight Visual Tree. Give this a try:
//Try to get a list of all the objects on the new radWindow
_silverlightApp.RefreshVisualTrees();
RadWindow radW = _silverlightApp.Find.ByType<RadWindow>();
var buttons1 = radW.Find.AllByType<TextBlock>();
PS This would be a great question to bring to the Telerik Testing Framework support forum .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.