Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DevExpress LookUpEdit And Coded UI Tests

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?

like image 804
bahadir arslan Avatar asked Nov 27 '25 09:11

bahadir arslan


1 Answers

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.

like image 85
Dave Neeley Avatar answered Nov 29 '25 00:11

Dave Neeley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!