Reputation: 81342
I'm busy running a proof of concept on what should be a very basic coded UI test.
My application is Winforms, I have a form that allows you to log in to the application.
Here 2 controls exist called _textUsername and _textPassword respectively.
To simplify the whole thing, I want playback to be able to double click the username text field (_textUsername).
However, during playback the _textPassword is selected.
I've tried to adjust the search criteria to include the control name , but then it fails to find the control at all and fails.
My question is simple: I have 2 controls on my form : _textUsername and _textPassword, UI coded tests seems to always find the _textPassword, how can I get it to find the other text box instead?
Upvotes: 0
Views: 1294
Reputation: 81342
This turned out to be wrong versions in DevExpress between the client application and the test runner code.
Upvotes: 0
Reputation: 172
Try manually coding the controls. You can use the UI Test Builder to find the search properties. inspect.exe is also useful. Sometimes the properties aren't what you expect.
// Controls
WinWindow logonWindow = new WinWindow();
WinEdit _textPassword = new WinEdit(logonWindow);
WinEdit _textUsername = new WinEdit(logonWindow);
// Add search properties and configurations
logonWindow.SearchProperties[WinWindow.PropertyNames.Name] = "Main Window Name";
logonWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
_textPassword.SearchProperties[WinEdit.PropertyNames.Name] = "Password";
_textPassword.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
_textUsername.SearchProperties[WinEdit.PropertyNames.Name] = "Username";
_textUsername.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
// Identify each control
logonWindow.DrawHighlight();
_textPassword.DrawHighlight();
_textUsername.DrawHighlight();
Upvotes: 2