I have a recorded item that can changes its window name dynamically depending on the runs. So using "Contains" to find the window name is a good idea, but implementing it does not seem intuitive.
I successfully changed this:
'Me.SearchProperties(UITestControl.PropertyNames.Name) = "ex(3)"
searchLimitContainer.SearchProperties.Add(UITestControl.PropertyNames.Name, "ex", PropertyExpressionOperator.Contains)
But cannot find how to replace this:
Me.WindowTitles.Add("Microsoft Excel - ex[3].xls")
searchLimitContainer.SearchProperties.Add(UITestControl.WindowTitles.Add, "Microsoft Excel -", PropertyExpressionOperator.Contains) //Does not work UITestControl.WindowsTitles.Add or WindowsTitles.add does not exist
Where can I find the proper call(not only for this one, but all the ones I would need)?
P.S. Yes I looked at the documentation, I did not find what I wanted.
Similar problems:
CodedUi :How to go about for search property of window when its title name keeps changing?
http://blogs.msdn.com/b/anutthara/archive/2009/08/19/using-regular-expressions-to-locate-controls-in-coded-ui-test.aspx
VS 2010 Coded UI Test Not Finding Window