How To Use A Utility Class In Test Studio Standalone Version
Problem
I would like to create/use global variables and/or functions in Test Studio Standalone version and access these from all tests within the current project.
Solution
Here you could read how to create a standalone code file within a Test Studio project. Below are listed two examples how a class file named Utility could be adjusted to cover two common scenarios: write text to external file and perform certain action against an element. The provided sample code requires reference to System.IO.dll and ArtOfTest.WebAii.Controls.HtmlControls.dll added in the project settings and the respective using statements in the code. Note that the namespace of the standalone code file must be the same as the namespace of the project.
Once the code file is ready for use compile the project to build the assembly. Then you'll be able to access the functions/variables within your Utility class from all tests in this project. Note that the Test Studio code editor will not auto-complete references to the contents of the Utility class.
How To Use Methods And Variables From The Utility Class File
The code sample below demonstrates how the global methods and variables could be accessed in a coded step.