1

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>();
ED209
  • 588
  • 1
  • 9
  • 26

1 Answers1

0

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>();

P.S. This would be a great question to bring to the Telerik Testing Framework support forum.

sircody
  • 214
  • 1
  • 5
  • Hi. Thank you for your answer. Sorry its taken me so long to get back to you. I have been on holiday. Ok I tried the above code but got the following exception:- "An exception of type 'ArtOfTest.Common.Exceptions.FindElementException' occurred in ArtOfTest.WebAii.dll but was not handled in user code Additional information: Element Not found! FindExpression used: [xamltag 'Exact' RadWindow]" – ED209 Nov 04 '14 at 15:10
  • That exception means it cannot find the RadWindow popup. Are you 100% sure you're working with a RadWindow? Obtaining a copy of the VisualTree (watch this video: http://www.screencast.com/t/m7NEmJMdO ) would help us see what you're dealing with exactly. But that may be nearly impossible if you don't have Test Studio installed. – sircody Nov 07 '14 at 17:44