Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hopefully fixing issue #165 #221

Merged
merged 1 commit into from
Jun 2, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/TestStack.White/UIItems/WindowItems/Win32Window.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Automation;
using TestStack.White.AutomationElementSearch;
using TestStack.White.Factory;
using TestStack.White.Sessions;
using TestStack.White.UIItems.Finders;
Expand Down Expand Up @@ -36,6 +39,16 @@ public override Window ModalWindow(string title, InitializeOption option)
WindowSession.ModalWindowSession(option));
}

public override List<Window> ModalWindows()
{
var descendants = new AutomationElementFinder(automationElement)
.Children(new AutomationSearchConditionFactory().GetWindowSearchConditions(automationElement.Current.ProcessId).ToArray());

return descendants
.Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache)))
.ToList();
}

public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
{
return windowFactory.ModalWindow(searchCriteria, option, WindowSession.ModalWindowSession(option));
Expand Down