Reference External Code Library File
Extending your test project with any custom code may require the usage of external libraries like various .NET assemblies, or your own specific assembly file. External assemblies are added as reference on project level in Test Studio and can be used from all tests in this project.
To add an external assembly in the project open the Project Settings -> Script tab. The Test Studio related dlls are referenced by default and you can see these listed in this window. Click the Add Reference button to browse for the external dll file.
Locate the assembly on your computer and click Open. For this example I added the System.Windows.Forms.dll, which can be found in the Windows GAC folder. The new dll will appear in the Project References list.
Tip
We recommend to add reference to .NET assemblies from the Global Assembly Cache. This way the references should be matched out-of-the-box, if you move the project on another machine.
If you need to add reference to a custom dll file, which is not installed in the GAC, we recommend to keep the library class file in a dedicated folder within the project root folder. That way the dll will be always deployed with the project and referenced from that location.
Once the external class library is referenced in the project you need to add using
(or Import
) statement in the coded file, where it will be used.