This one is kind of advanced.

You can add a coded step to your test (or convert  an existing step to code). When you do that - a so-called "code-behind file" is generated. The file in question is simply a C#/VB class file that has the exact same name as your test:

 

You can open and edit the entire class file from Standalone by using the View Class button:

And you'll be able to do anything you would expect from a class file - define custom functions, add assembly references, define global variables etc. In fact, all your coded steps are, in fact, auto-generated functions in this class.

Here's the tricky bit: you can use the GUI to delete all the coded steps from a tests. But the class file will not be removed by this. It will continue to exist and be compiled along with the rest of the test. That means that any potential compilation errors that you might have left in there will come out as you try to build the project. And they will cause compilation errors.

Unless you have a good reason not to - I highly recommend that you get rid of all unnecessary class files. A class file is probably not necessary if there are not coded steps in that particular test. In fact it's easy to miss that there's even a code-behind file associated with the test if there are no coded steps in it. We have button that will take care of this kind of thing. We suggest you use it liberally when trying to get rid of compilation errors in your project:

About the author

Stoil Stoichev

Stoil Stoychev

has been helping customers solve their complex testing challenges leveraging his in-depth knowledge of Telerik Test Studio. He has traveled the globe fine-tuning his technical expertise and helping our valued clients succeed. In his spare time he enjoys motorcycles, live music and various sports.


Related Posts

Comments

Comments are disabled in preview mode.