Is it possible to expose hand coded functions as shared steps?
Asked Answered
P

2

6

We are looking into coded UI, and since we have C# coding experience we'll be coding up the automated tests ourselves.

I already know that it is possible to have a test case with defined test steps. Each test step is actually a function inside the test method and the description comes from the summary.

This is a great way for the c# coders to expose what they're doing to the non coding testers who will interact with these automated tests using MTM (Microsoft test manager).

However, it would be awesome if the C# coders were able to create generic functions as "Shared Steps" perhaps, and in this way non technical testers were able to assemble new tests in MTM using these building blocks.

Functions such as : Open the settings dialog, Maximize Window, Add an item (with parameters), Close all open tabs, etc.

However these would be coded functions, not from a recording.

The idea would be that once these functions are created and stored in TFS (Again as shared steps), the tester would then be able to use these functions as building blocks for more automated tests.

I also have to stress that these functions will be fully automated, and so new tests assembled in MTM too need to be fully automated without needing to open up Visual Studio.

Is this at all possible?

Peppermint answered 19/5, 2014 at 13:53 Comment(1)
We've been trying to discover a way to do this at my work as well. From what I've discovered, the shared steps available in MTM aren't accessible from a c# project class, and vice versa.David
C
2

An approach used by some people is to create a test framework containing many useful functions. The test itself is then written as a data driven Coded UI test, each step being one entry from the data source. (Typically each step might be one line in CSV file.) Some columns of the data source would be commands and others data for those commands.

The commands could be relatively low level such as: find a window, navigate to a page, run an application, find a control in a window, enter text into a field, click a button or a link, verify that a field contains a given string.

Commands could be for higher level activities in your applications, such as: login, fill in a form.

Frameworks can let non coders write tests using terminology they understand. Frameworks are challenging to write.

Chump answered 7/8, 2014 at 13:38 Comment(0)
T
1

This isn't really possible in the way you're asking - you will not be able to have your non-technical testers creating automated tests from test manager. A coded UI test will always have to exist as a test in a code file.

All of the details for a test manager test are available through the TFS API, so I suppose it should be possible to create your own layer that could generate coded UI code based on a shared step mapping system, but it would be a fairly major undertaking - its probably easier to have automated tests created by technical people.

Tuesday answered 7/8, 2014 at 11:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.