Key Codes for Coded UI Tests

A colleague of mine asked me this week how he can emulate special keys in Coded UI Tests. I knew that I wrote that in my book but actually did not find the official reference in the MSDN. That’s why I will provide it here again. The Keyboard class provides different methods with which you can send texts or key codes to the UI element currently selected. Some of these methods also allow the use of modifier keys like Ctrl or Alt. All special keys are shown in the following list. They are usually surrounded by curly braces and can be part of any string (see also the example above). Key Code Backspace {BACKSPACE}, {BS} or {BKSP} Pause {BREAK} Capslock {CAPSLOCK} Delete {DELETE} or {DEL} End {END} Return {ENTER} or ~ Esc {ESC} Help {HELP} Pos1 {HOME} Insert {INSERT} or

Weiterlesen »

All I wanted was a pyramid…

… and all I got was this lousy Christmas tree. I like TDD and I like test automation. It is great to see the application growing with each successful test and to be sure that it will work even if a lot of changes are made on the code base. On the other I see (especially) TDD as a practice which is hard to master and I can understand people who drop any ambition because it feels intricate and some times frustrating in real projects. One of these things is for example the advice to use baby steps to drive the implementation. I thing this advice is essentially to TDD and makes, from my point of view, the difference between Test First and Test Driven Development. Baby steps means, that you are not allowed to implement more functionality than needed by your tests. If

Weiterlesen »

„MS Test the IE6 of Unit Test Frameworks?“

2010/2011 Roy Osherove wrote in his blog a sentence which summarizes an opinion you can still find in many other blogs: „MSTest is the IE6 of Unit Test Frameworks.“ . He basically says, that MS Test has a lack of functionality when it comes to unit testing and I agree with him with one exception:  I think it is not primarily a unit testing framework, it is a test automation framework but lets start with a comparison.

Weiterlesen »