5

I am using Coded UI for creating functional tests of a WPF application. That application is having a main menu which user needs to click in order to navigate to different screens.

Issue is: If I launch application manually (like navigating to the application path and then double clicking the .exe file), then running my test (just to debug), then Coded UI is able to recognize the Child Menu items and is able to click them.

But, if I launch application using the code provided below, then the same Coded UI code is not able to click the Child Menu items.

ApplicationUnderTest AUT = ApplicationUnderTest.Launch(@"D:\Calc\Code\Calc.Application\Calc.Application\bin\Debug\Calc.WPF.exe");

Even, if I use Coded UI highlighter which is displayed in recording mode, then that highlighter is not able to recognize Child Menu items.

Let me know if anyone has faced this kind of issue or how to resolve it?

Exception: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: 
TechnologyName:  'UIA'
FrameworkId:  'Wpf'
ControlType:  'RadioButton'
AutomationId:  'ABC'
1

It is clear from the Exception that Coded UI is unable to find the control. Whereas objects in a web page can have browser window as the parent but for WPF application you need to specify the object with the correct parent otherwise Coded UI won't be able to identify it during execution. Check that the parent of the RadioButton object is correctly defined as shown in the "UI Control Map". I'm assuming you are using the hand coding approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.