Home Dashboard Directory Help

FindMatchingControls API returns empty list when we check on the WPF application topwindow by Nagasree


 as External Help for as External

Sign in
to vote
Type: Bug
ID: 790300
Opened: 6/17/2013 2:25:38 AM
Access Restriction: Public
User(s) can reproduce this bug


     Iam using CUIT 'FindMatchingControls' on the WPF application topwindow and checking the 'Exists' property before performing action on the control to make sure that iam performing action on the correct instance of the control when there are more than one instance of application.

But FindMatchingControls returning empty list even one/more instances are present and then Exists property returning 'FALSE'.Exists property return false only after using FindMatchingControls API .

We are seeing this issue in VS2010 mainly and we checked in VS2012 also.Here is the MSDN Forum link (http://social.msdn.microsoft.com/Forums/en-US/vstest/thread/78603999-bae4-4d9a-ab16-f8dadb2d23cd)
Sign in to post a comment.
Posted by Nagasree on 7/24/2013 at 4:46 AM

The workaround you suggested is not working as expected.It is giving the count including other technology main windows also.
Posted by Nagasree on 7/4/2013 at 11:56 PM

Sorry for the late reply.

In our test method we want to perform action on specific instance of the application if there are more than one running at that moment. To confirm that we get all instances ,compare the ProcessId ,and then perform action on the instance which we want to do

Posted by Microsoft on 6/26/2013 at 2:44 AM
Please also let us know of your scenario here. Why is FindMatchingControls of a top level window important?
Posted by Microsoft on 6/19/2013 at 4:01 AM
Thanks for your response.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Nagasree on 6/17/2013 at 10:30 PM

I submitted the Coded UI Test project and sample WPF application project.If we run the ordered test,we can see the issue.Still you need information let me know.

Posted by Microsoft on 6/17/2013 at 8:11 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

Please submit this information to us within 4 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 6/17/2013 at 2:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Microsoft on 6/26/2013 at 2:43 AM
Commenting out the recorded "HwndWrapper" class name for the WPF window works (Specifically this line of code: "this.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));" ).

Before we go about fixing this may we know your scenario here?
File Name Submitted By Submitted On File Size  
WpfApplication3.zip 6/17/2013 49 KB
WPFWindowsProblem.zip 6/17/2013 673 KB