You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Application app = Application.AttachOrLaunch(new System.Diagnostics.ProcessStartInfo(AUT));
var window = app.GetWindow("Main window ");
//get all panes
var panes = window.GetMultiple(SearchCriteria.ByControlType(ControlType.Pane));
//get contact pane
var pane_contact = panes[3] as Panel;
//get option button inside pane
var button_option = pane_contact.Items[0] as Button;
button_option.Click();
//Get window
var options_Window = window.ModalWindow("window includes tree which is opened from main
window");
//Get tree
var trees = options_Window.Get<Tree>(SearchCriteria.ByControlType(ControlType.Tree));
var rootNode = trees.Nodes[0] as TreeNode;
var nodes = rootNode.Nodes;
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.
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);
}
Activity
maninwindow commentedon May 6, 2016
I solved problem myself.Let me share the code to help people who have the same issue.