Using Visual Studio Coded UI Test for Wizard

Wizard for WPF Forum

Posted 8 years ago by Yuriy Stasiv
Version: 11.1.0541
Avatar
Hello,
I have a problem with Visual Studio Coded UI Test for Wizard control. Coded UI Test can't find the navigation buttons(next, back etc) with error:
The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'UIA'
ControlType: 'Button'
AutomationId: 'PART_NextButton'
Search may have failed at 'Wizard' Pane as it may have virtualized children. If the control being searched is descendant of 'Wizard' Pane then including it as the parent container may solve the problem.


As I understand test framework cannot find button container using the following parameters:
this.SearchProperties[WpfPane.PropertyNames.ClassName] = "Uia.WizardButtonContainer";
this.SearchProperties[WpfPane.PropertyNames.AutomationId] = "PART_ButtonContainer";
this.WindowTitles.Add("Wizard QuickStart");
this.WindowTitles.Add("Wizard QuickStart - Interior Page");
Could you explain me how I should configure search parameters for searching navigation buttons.

[Modified at 07/04/2011 09:44 AM]

Comments (6)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Yuriy,

The Wizard control is pretty simplistic, it's just a Control with a ControlTemplate that has has another templated control with buttons on it. This is probably more of a question you should pose to Microsoft since UI automation finds our buttons fine, as does Coded UI Test when you build the test.

After some searching, perhaps Coded UI Test isn't as robust for handling templated controls as you would think:
http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/39125b9a-4fa3-4e09-b3d9-cc9a41c7f5ed/

It looks like it may be a design limitation of Coded UI Test by Microsoft and unfortunately probably isn't something we can fix.


Actipro Software Support

Posted 8 years ago by Alexey Klimenko
Avatar
Hi
Thank you for the hint but it would be great if you could assist us further as it may influence our choice of controls as it is imperative to have UI test automation.
We have created a simple app with your wizard (you had it attached).

After some code inspection we have identified that button container cannot be found by SearchProperties (WizardButtonContainer). On the other side we tested our custom controls with control templates and they worked fine.

Could you please try it on your side and if not solve the issue, at least give a workaround?

Thank you,
Alexey
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Alexey,

We were able to reproduce the issue before. Unfortunately, this appears to be an issue with Coded UI that would have to be addressed by Microsoft. UISpy is able to view/find the container and the buttons. Also, the fact that Coded UI can record everything fine indicates it can find the controls. It just appears to be an issue with how Coded UI resolves the tests after the fact.


Actipro Software Support

Posted 8 years ago by Alexey Klimenko
Avatar
Hi
Thanks for the swift reply.
Is there a chance that you file a bug report to MS (if haven't already done)? I think it is best that you do it as we do not have sufficient knowledge of the issue and your code to do that.
Kindest Regards,
Alexey
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Alexey,

I've marked down a TODO item to create a sample and file a bug report.


Actipro Software Support

Posted 8 years ago by Alexey Klimenko
Avatar
Hi. Thank you! Please tell if you have any news.
The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.