문제

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?

도움이 되었습니까?

해결책 2

This turned out to be wrong versions in DevExpress between the client application and the test runner code.

다른 팁

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();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top