This is a migrated thread and some comments may be shown as answers.

Enable Coded UI tests by default

6 Answers 29 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 05 Mar 2014, 09:58 AM
Hi,

Not sure where this best belongs. Basically I am looking to change the default value of the EnableCodedUITests property for all controls that use it to true instead of the default false.

I don't want to do this on a per control basis or a per project basis I want to do it globally.

Thanks in advance for the help.

6 Answers, 1 is accepted

Sort by
0
Stephen
Top achievements
Rank 1
answered on 05 Mar 2014, 12:36 PM
Hmm, can't seem to edit my post.

Just to elaborate on this: The reason I wish to do this is because it would speed up development since I have to set them to true for each control to test using visual studio coded ui tests...otherwise odd things happen.

As an example: If I run a test on a rad ribbon, if the rad ribbon does not have the control enabled then the mouse gets stuck on the tab of the ribbon.
0
Peter
Telerik team
answered on 07 Mar 2014, 09:07 AM
Hi Stephen,

Thank you for writing and for your request.

I would like to start with clarifying that Microsoft did not provide good support for CodedUI for third party controls and we do our best to provide such support when possible. Unfortunately, Microsoft relies on the same mechanism (MSAA) in the controls which are already used from Windows Narrators (Narrator, JAWS and more) and turning on by default this property will greatly affect them and every developer which use our controls should set explicitly this property to false in order to provide proper narrator support on the client machines.

For this reason we decided to set this property by default to false.

Regards,
Peter
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Stephen
Top achievements
Rank 1
answered on 08 Mar 2014, 07:04 PM
Hi Peter,

First thanks for the reply. So is there no way of enabling the property to true?

I can understand the reasoning behind setting it to false but if I can change it to true for myself that is what I would like to do.

Regards,

Stephen.
0
Accepted
Peter
Telerik team
answered on 10 Mar 2014, 08:36 AM
Hello Stephen,

Thank you for writing back.

Since, we cannot set this property by default to true for the controls you should set it manually explicitly for these controls which will be included in your CodedUI tests.

I hope this is applicable for your scenario.

Regards,
Peter
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Stephen
Top achievements
Rank 1
answered on 11 Mar 2014, 02:26 PM
Thanks Peter,

This is what I suspected, that it wouldn't be possible. However I've come up with the following solution that (so far) is working nicely.

foreach (var item in FindForm().Controls)
            {
                try
                {
                    if (item.GetType().BaseType == typeof(RadControl))
                    {
                        ((RadControl)item).EnableCodedUITests = true;
                    }
                }
                catch
                {
                    continue;
                }
}

I do expect to run into problems eventually with the above code but for the most part it does exactly what I want, it goes through each element and sets enable coded ui to true without the need to traverse old elements which would be time consuming.
0
Peter
Telerik team
answered on 12 Mar 2014, 12:45 PM
Hi Stephen,

Thank you for sharing you solution with us.

I can confirm that your approach to set this property is correct.

Let me know if you have other questions.

Regards,
Peter
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
General Discussions
Asked by
Stephen
Top achievements
Rank 1
Answers by
Stephen
Top achievements
Rank 1
Peter
Telerik team
Share this question
or