Code-Behind File
Standalone version
You can create a code behind file for each test where you can implement coded steps and custom test classes.
There are two methods of creating a code behind file for your test.
1. Add a coded step from the Step Builder.
2. Right click on a step and select Edit in Code from the Test Step Context Menu.
.
Every method in the code-behind file is represented in the coded step drop down .
Every coded step can be mapped to any method in the code-behind file.
Do not remove the CodedStep attribute. This is how Test Studio recognizes custom coded steps versus other methods it should ignore.
The code-behind file has access to all Telerik run-time objects, like ActiveBrowser. This is an identical coding experience to the Telerik Testing Framework.
Visual Studio plugin
There are three ways how to add a code-behind file in Visual Studio plugin.
1. Click Add code-behind file to your test button
2. Add a coded step from the Step Builder.
3. Right click on a step and select Edit in Code from the Test Step Context Menu.
The code-behind file is nested under the parent test in Solution Explorer:
Code Editor in Standalone Version
The code editor in version 2019 R3 and later has a Quick Find and Quick Replace features to make it easier to navigate and maintain your code. You can open it from the Find icon in the top bar, or standard CTRL+F shortcut.
The search and replace functionality is against the file that is currently open.
The code editor has a context menu with more actions. You can comment or uncomment your code from the context menu or with CTRL+K and CTRL+U shortcuts respectively.
See Also: