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

Childwindow visualtree not getting updated

2 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kiran
Top achievements
Rank 2
Kiran asked on 27 Jul 2010, 06:39 PM
Hi,

I am using WebAii 2010.1 for automating silverlight 3 application.
In my application i am having childwindow in which i am loading a wizard like control.
In that wizard controls are created dynamically.

But i am not able to get those dynamically created controls.
I tried refreshing the visual tree like below but not working.

app.RefreshVisualTrees();

app.VisualTree.Refresh();

app.Popups[0].VisualTree.Refresh();


Please help me its urgent.....
Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 27 Jul 2010, 11:22 PM
Hi Kiran,

Just to confirm, did you add the PopupTracker() as described in this blog? And are you checking the count after th windows are opened? The windows are not enumerated unless they are launched.

Sincerely,
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
Kiran
Top achievements
Rank 2
answered on 28 Jul 2010, 09:25 PM
Hi,

I got the issue and its resolved now.
I was using the below code
Button btnShowPopup = CurrentApplication.Find.ByName<Button>("btnShowCreateUserWindow");
          btnShowPopup.User.Click();
            
          Thread.Sleep(3000);
          CurrentApplication.RefreshVisualTrees();
          VisualTreeHost popupControl = CurrentApplication.Popups.FirstOrDefault();
          Button btnCreateControl = popupControl.VisualTree.Find.ByName<Button>("btNext");
          btnCreateControl.User.Click();
          Thread.Sleep(2000);
          CurrentApplication.RefreshVisualTrees();
          CurrentApplication.VisualTree.Refresh();
          CurrentApplication.Popups.FirstOrDefault().VisualTree.Refresh();
           
          TextBox txtBox = popupControl.VisualTree.Find.ByName<TextBox>("txtBox");

The mistake i have done is i took a reference of the popup in the variable popupControl.
popupControl reference will not get refreshed. I can do either of the statement to fix this. 

 popupControl.VisualTree.Refresh();
or
popupControl=CurrentApplication.Popups.FirstOrDefault();

Thanks for your reply Nelson.

Thanks
Kiran
Tags
General Discussions
Asked by
Kiran
Top achievements
Rank 2
Answers by
Missing User
Kiran
Top achievements
Rank 2
Share this question
or