WebAii cannot find my PopUp after RefreshVisualTrees()

7 posts, 0 answers
  1. Edmond
    Edmond avatar
    5 posts
    Member since:
    Sep 2008

    Posted 22 Jul 2010 Link to this post

    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
  2. Missing user
    Missing user avatar

    Posted 22 Jul 2010 Link to this post

    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
  3. Edmond
    Edmond avatar
    5 posts
    Member since:
    Sep 2008

    Posted 22 Jul 2010 Link to this post

    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.
  4. Kiran
    Kiran avatar
    56 posts
    Member since:
    Dec 2008

    Posted 23 Jul 2010 Link to this post

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

     

    }

     

  5. Edmond
    Edmond avatar
    5 posts
    Member since:
    Sep 2008

    Posted 23 Jul 2010 Link to this post

    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
  6. Kiran
    Kiran avatar
    56 posts
    Member since:
    Dec 2008

    Posted 23 Jul 2010 Link to this post

    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
  7. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 23 Jul 2010 Link to this post

    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
Back to Top