Open maninwindow opened 8 years ago
I solved problem myself.Let me share the code to help people who have the same issue.
//open window
//// close any open windows
window.Focus();
var allOpenWindows = window.GetMultiple(SearchCriteria.ByControlType(ControlType.LookupById(0x50CF6)));
var windows = app.GetWindows().Where( w =>w.Name != window.Name);
foreach (var item in windows)
{
item.Close();
}
windows = app.GetWindows().Where(w => w.Name != window.Name);
var options_Window = windows.First();
//Get tree
var trees = options_Window.Get<Tree>(SearchCriteria.ByControlType(ControlType.Tree));
//move to the last tab
for (int i = 0; i <= 13; i++)
{
trees.KeyIn(KeyboardInput.SpecialKeys.DOWN);
}
I am working on a Windows desktop application that contains interactive window tree like below: (Right window will change by selecting different tree item from the left) What i inspected by UIAVerify is below: When i select tree: When i select one tree item:
My code is below:
I can get one tree element in variable trees, but nothing in variable nodes as items. Can anybody explain am i doing the right thing? Why it can't be found? If i was wrong, please share your idea. Thanks in advance.