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

WebAii cannot find my PopUp after RefreshVisualTrees()

6 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Edmond
Top achievements
Rank 1
Edmond asked on 22 Jul 2010, 03:44 PM
Hi,

I am currently trying to use WebAii to automate some of the test cases in our application. Our application contains a lot of Popup, so being able to provide automation on the Popups is crucial to our test framework.

The problem right now is that after creating a Popup using new Popup() and invoking Telerik.WebUI.PopupTracker.Track(popup) in our class, and invoking RefreshVisualTrees() in my unit test method, the number of items in the Popups collection of the Silverlight app is still at 0. Any insight?

A developer told me that our Popups are wrapped inside our own class. Would that be an issue?

Regards,
Edmond Chan

6 Answers, 1 is accepted

Sort by
0
Missing User
answered on 22 Jul 2010, 11:44 PM
Hi Edmond,

Just to confirm, are you opening the popups before checking the collection count? The popups are not enumerated until one or more popup windows are opened.

Kind regards,
Nelson Sin
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
Edmond
Top achievements
Rank 1
answered on 23 Jul 2010, 12:06 AM
Hi Nelson,

Yes, I am fairly certain that the popup is opened. I even tried doing Thread.Sleep(), setting breakpoint and recheck the count in the watch window, and still no luck.

Visually, I do see the popup window showing up in our silverlight application, which is another check that the popup is created properly.
0
Kiran
Top achievements
Rank 2
answered on 23 Jul 2010, 05:12 AM
Hi Nelson,

I have aslo tried out the same thing i got it.
Are you using SL4 or SL3 ? Also give the version of the WebAii.( Specify full version dont just give WebAii 2.0)
Also could you please send me a sample to my emai ID kiran.b.chandran@gmail.com
The below code is woring for me.
SilverlightApp CurrentApplication; 
private SilverlightApp LaunchApplication()
        {
            Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
            ActiveBrowser.NavigateTo("http://localhost:1997/RadControlSampleTestPage.aspx");
  
  
            // Get an instance of the running Silverlight Application.
            CurrentApplication = ActiveBrowser.SilverlightApps()[0];
              
            //To activate the silverlight control
            CurrentApplication.Desktop.Mouse.Click(MouseClickType.LeftClick, CurrentApplication.Bounds);
            return CurrentApplication;
        }
  
        [TestMethod]
        public void PopupTest()
        {
  
            LaunchApplication();           
  
            Button btnShowPopup = CurrentApplication.Find.ByName<Button>("btnShowPopup");
            btnShowPopup.User.Click();
            //Thread.Sleep(3000);
            CurrentApplication.RefreshVisualTrees();
            //CurrentApplication.VisualTree.Refresh();
              
  
            Thread.Sleep(10000);
        }

Popup

 

private void btnShowPopup_Click(object sender, RoutedEventArgs e)

 

{

 

 

Popup pop = new Popup();

 

 

 

UserLookup userLooup = new UserLookup(); //User Control

 

 

pop.Child = userLooup;

pop.IsOpen =

true;

 

 

 

PopupTracker.Track(pop);

 

}

 

0
Edmond
Top achievements
Rank 1
answered on 23 Jul 2010, 03:51 PM
Hi Kiran,

Our application is a SL4 application, and we are using WebAii that is bundled in the 2010 Q2 version with the version number 2010.2.713.0.

After some reverse engineering on the assemblies we have found out the problem and solution. We exported the ArtOfTest.SLExtension.dll to browse its content, and the problem is in ArtOfTest.WebAii.Silverlight.ReflectionUtils.GetAssemblies(). The method only gets assemblies that are already in XAP, but our application dynamically loads Telerik.WebUI.PopupTracker, so WebAii was never able to find the tracker correctly.

A workaround is to force the assembly to load into XAP earlier using the class below:
    public class ForcedReferences
    {
        public ForcedReferences()
        {
            Telerik.WebUI.PopupTracker.GetPopups();
        }
    }

If Telerik can lift this limitation by also searching for dynamically loaded assemblies in ReflectionUtils, that would be great.

Regards,
Edmond Chan
0
Kiran
Top achievements
Rank 2
answered on 23 Jul 2010, 03:55 PM
Hi Man,

You are great...... Found the issue and solution too.
I am also doing a proof Of Concept for WebAii for Silverlight 3.0.

Could you share your email id or contact information so that i could get help assistance from the right people.

Thanks
Kiran
0
Cody
Telerik team
answered on 23 Jul 2010, 05:35 PM
Hello Kiran,

I am glad you found a working solutiion. It is our official recommendation that a reference to our popup tracker dll be added to your main Silverlight application project as documented in this blog post.

We will research into searching dynamically loaded dll's for a future version.

Regards,
Cody
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
Tags
General Discussions
Asked by
Edmond
Top achievements
Rank 1
Answers by
Missing User
Edmond
Top achievements
Rank 1
Kiran
Top achievements
Rank 2
Cody
Telerik team
Share this question
or