Unable to get Window by partial title

Oct 25, 2011 at 1:29 AM

White doesn't appear to allow you to get a window by a partial title match. 

Our application under test's window titles change depending on what subwindows are open, and what data is available in each subwindow.

For example, the main application window title might be:


ApplicationTitle - SubWindowTitle

And the Sub Window title could be:

SubWindowTitle - SomeData: 100

Is there a workaround for this? We can't really test our app with White due to this limitation, and are stuck with QTP :(

If not, it would be super cool if it allowed searching based on Regex, but also would be fine if it allowed a simple boolean to be passed through to ask for a partial match (ie code would use string.contains)

Oct 25, 2011 at 12:18 PM





app.getWindows().Where(p=>p.Title.Contains("part string"));



Oct 25, 2011 at 8:11 PM

Here's what we do with Regex:

            Window temp_window = null;

            List<Window> windows = Desktop.Instance.Windows();

            int imax = windows.Count;

            for (int index = 0; index < imax; index++)
                    switch (MyWindowSearchProperty)
                        case WindowSearchProperty.Name_Partial:
                            if (Regex.IsMatch(windows[index].Name, ".*" + MyWindowSearchValue + ".*") || windows[index].Id.Equals(MyWindowSearchValue))
                                temp_window = windows[index];