4 Answers, 1 is accepted
0
Hello Jeff,
Boyan Boev
Telerik
If you would like to create global variables or functions in Test Studio Standalone version that are accessible from all the tests within the test project, you can create a utility class. This class will contain the intended functions or variables.
Let me know if this helps.
Boyan Boev
Telerik
0
Jeff
Top achievements
Rank 1
answered on 16 Oct 2013, 02:46 PM
Boyan,
Thanks for the reply. I ended up creating my own class in Visual Studio and added it to my tests project folder. I found documentation on how to do this after I created this thread. Which method do you think is best, using my own class like I am doing or using the utility class like you described in your post?
Thanks,
Jeff
Thanks for the reply. I ended up creating my own class in Visual Studio and added it to my tests project folder. I found documentation on how to do this after I created this thread. Which method do you think is best, using my own class like I am doing or using the utility class like you described in your post?
Thanks,
Jeff
0
Daniel
Top achievements
Rank 2
answered on 16 Oct 2013, 03:50 PM
Personal opinion, definitely using your own class. Quote from a support ticket I had kind of lays it out there:
"Because you are using Visual Studio instead of our standalone Test Studio IDE it's actually easier (and IMO better) to use Visual Studio's Add Class feature (see attached screen shot). Then put your static class in this file. You can then reference and use it from your coded steps the same way you would with regular programming. Then you don't have a wasted class or overhead of an empty test."
I was using the Utility Class in the beginning, and it kind of became a bit hairy. I jump back and forth between Visual Studio and the Test Studio IDE (only because the Test Studio IDE code editor lacks a lot of features), but still don't have any issues using the stand alone class.
"Because you are using Visual Studio instead of our standalone Test Studio IDE it's actually easier (and IMO better) to use Visual Studio's Add Class feature (see attached screen shot). Then put your static class in this file. You can then reference and use it from your coded steps the same way you would with regular programming. Then you don't have a wasted class or overhead of an empty test."
I was using the Utility Class in the beginning, and it kind of became a bit hairy. I jump back and forth between Visual Studio and the Test Studio IDE (only because the Test Studio IDE code editor lacks a lot of features), but still don't have any issues using the stand alone class.
0
Hello,
Velin Koychev
Telerik
@Jeff - As Daniel stated, it would be reasonable to use the approach from this article if you are using Test Studio IDE. If you are using Visual Studio, you might find Visual Studio's Add Class feature (as you currently do) much more useful.
@ Daniel - Thank you for sharing your experience.
Velin Koychev
Telerik