DevExpress LookUpEdit和编码UI测试 [英] DevExpress LookUpEdit And Coded UI Tests

查看:265
本文介绍了DevExpress LookUpEdit和编码UI测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Windows Forms和DevExpress控件开发软件。



我们还要使用Coded UI测试来自动测试我们的应用程序。
$ b

由于我们最近的经验告诉我们,DevExpress不支持CUIT。



但是,我们没有选择,不能从DevExpress控件中放弃,从CUIT中放弃。



最近我创建了一个使用MTM测试一个包含LookUpEdit控件的表单的测试用例。正如你所猜想的,我无法正确使用参数。



有没有办法解决这个问题?

解决方案

为继承自 Control.ControlAccessibleObject CustomAccessibleObject >。然后覆盖控件上的 CreateAccessibilityInstance()方法,以便返回一个 CustomAccessibleObject



在您的控制中:

  public class MyControl:SomeDevExpressControl 
{
protected override AccessibleObject CreateAccessibilityInstance()
{
返回新的MyCustomAccessibleObject(this);
}
}

public class MyCustomAccessibleObject:Control.ControlAccessibleObject
{
//覆盖这里的
}

请参阅 http://msdn.microsoft.com/en-us/library/system.windows.forms.accessibleobject.aspx
有关详细信息。 p>

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?

解决方案

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.

这篇关于DevExpress LookUpEdit和编码UI测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆