0
votes

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

1

1 Answers

0
votes

The answer is here:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/a948a107-7e41-4525-a869-38b99da9c32c/dynamic-window-title-that-cannot-search-by-coded-ui-test

Can't believe I missed it for an hour.

UIApplicationv1013Window.SearchProperties.Add(WinWindow.PropertyNames.Name, "Application v", PropertyExpressionOperator.Contains)