Using a .NET assembly (DLL) with Test Complete 7.52

There are two steps to adding and using a .NET dll to your automated suite. First you must add a reference that tells your script where to find the dll and second you need to call the method in your .NET dll. Read on or download the PDF at the bottom of this post. It is real simple!

Adding a reference to TestComplete for your DLL
1. Launch your Project Suite.
2. Right click on your Project and choose Edit >> Properties.
3. Click on “CLR Bridge”.
4. Click on the Browse Files button and locate your file.
5. Select your file and click the Open button.
6. Notice that the file is now listed in the Selected Components, like below:
7. Set your preferred architecture and apartment models.

Referencing your DLL through C# scripting

Add a line to your C# script with the following components:
Str = dotNET[“AutomationHelpers”][“UninstallProgram”][”FindAndUninstallProgram”](product);
1. Str would be the return value of the function you are calling and it is optional.
2. dotNET tells TestComplete that you are calling a .NET dll.
3. [“AutomationHelpers”] would be the namespace value in your dll.
4. [“UninstallProgram”] would be the class name in your dll.
5. [“FindAndUninstallProgram”] would be the function name you wish to call.
6. (product) is your parameter list for the function you are calling.

Adding a DOTNET DLL to TestComplete Projects

Facebook Twitter Linkedin

Related posts:

  1. Add JavaScript to your WordPress plugin.
  2. Adding AJAX to your WordPress plug-in
  3. Tag Grouping Plug-in Documentation
  4. WordPress 3.0 and add_action
  5. Updated Summary Sheet in Excel (QA Test Scenario Template)

About Mike

I am a Software Quality Assurance Professional that recently graduated college with a Bachelor's of Science in Computer Information Systems.
This entry was posted to the following categories: Automation, Test Complete. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>