Code-Behind File

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 coded behind file for your test:

  1. Add a Coded Step from the Step Builder.

    Add Coded step

  2. Right click the test and select Add Code-Behind.

    Add Coded Behind

    Select coding language.

    Select coding language

Both actions create a code-behind file with an empty test method where you can implement your custom code. Each code behind file can contain multiple test methods.

See Coded Steps article which describes how to execute the code in the test method.

You can also implement multiple test classes in a single code behind file. If methods of the test class will be bound to coded steps the class must inherit IOSTestBaseAndroidTestBase or WebTestBase class depending on the type test you are using as shown below.

Class code

In order to use the methods from a particular class you should bind the test to that class. You can do this from the test's properties, select the test from the Project Explorer so its properties are shown in the Properties pane.

Class map

See Also

In this article
Not finding the help you need? Improve this article