subject:"[White] How to get the parent of a child element that i find on screen? (#46)"

401 views
Skip to first unread message

kaushik choudhury

unread,
Jan 7, 2013, 6:47:17 AM1/7/13
to teststa...@googlegroups.com



Here is a quick snippet anyways which may help (I have not hit this scenario, so there may be better ways in white)..

var automationElement = window.Get<Button>("SOmething").AutomationElement.FindFirst(TreeScope.Parent, Condition.True);

This will get the automation element, it will not get the White control. I will try to look into it closer when I get some time

kaushik choudhury

unread,
Jan 9, 2013, 11:22:15 PM1/9/13
to teststa...@googlegroups.com


I was able to get the parent using the following
System.Windows.Automation.AutomationElement parent = System.Windows.Automation.TreeWalker.RawViewWalker.GetParent(child.AutomationElement);



Reply all
Reply to author
Forward
0 new messages