DevExpress LookUpEdit And Coded UI Tests

你离开我真会死。 提交于 2019-12-06 07:16:32

问题


We are developing software using Windows Forms and DevExpress controls.

And also we want to use Coded UI tests to test our application automatically.

As our recent experiences taught us that DevExpress does not support CUIT.

But we have no options to neither give up from DevExpress control nor give up from CUIT.

Recently i created a test case using MTM that tests a form which includes LookUpEdit controls. As you would guess i couldn't use parameters correctly.

Is there any way to workaround this problem?


回答1:


Create a CustomAccessibleObject for each of your controls that inherits from Control.ControlAccessibleObject. Then override the CreateAccessibilityInstance() method on your control so that it returns a CustomAccessibleObject.

In your control:

public class MyControl : SomeDevExpressControl  
{
    protected override AccessibleObject CreateAccessibilityInstance()
    {
        return new MyCustomAccessibleObject(this);
    }
}

public class MyCustomAccessibleObject : Control.ControlAccessibleObject
{
    //override stuff here
}

See http://msdn.microsoft.com/en-us/library/system.windows.forms.accessibleobject.aspx for more details.




回答2:


As far as I know, DevExpress controls are supported by TestComplete framework. We (at DevExpress) aren't aware of other frameworks which support our tools. I am not familiar with the Coded UI framework and cannot help you to adapt it using our controls :(.



来源:https://stackoverflow.com/questions/5645844/devexpress-lookupedit-and-coded-ui-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!