Coded UI: WinForms applications

I’ll gloss over the “Why” of this…

Doing it (testing against WinForms applications) nonetheless reinforces the point that these are just implementations of Page Objects.

Frustrating point of the day: the lack of obvious correspondence between the properties exposed in the WinForms / C# editor for a given control, and what is exposed by the Coded UI Test Builder and SearchProperties collection in .Net / C#. I was going to do an example, and I shall regret not doing it as I shall forget the case.

Take this:

Calc01

Firstly, I had to change the “*” in the original to “mult”, as it appears that without escaping (I’m guessing) then “*” is not recognised or mis-translated. That aside, this is what WinForms says about it (I picked the app up from some msdn place, hence the misspelling):

Calc02

Calc03

So based on this, the Name is either btnMulitply or there is no name, or it’s the parent object. Note that Text is “mult”.

Now the code finds flaming “mult” as Name… which is quite frustrating. And as for the Edit control, well, there isn’t ANY way that I can see to uniquely identify that.

But at least the weekend yielded a good find in the form of the Page Object implementation on CodePlex. I still can’t work out if this is Microsoft work, given the Namespace.

https://codeduicodefirst.codeplex.com/

Oh, there is this good thing as well, which identifies all the objects on your desktop.

http://uiautomationverify.codeplex.com/releases/view/112069

This data driven attribute was a nice find as well:

Calc04 Calc05

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s