Micro Focus QTP (UFT) Forums
usage of custom dll's - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: usage of custom dll's (/Thread-usage-of-custom-dll-s)



usage of custom dll's - bruegge - 10-13-2010

Hello,

I am still very new to QTP, however I am in the following situation:

Our team has programmed an automated UI test in C# and created a DLL containing a method to run this UI test. Now we would like to start this from QTP and get a proper report back to QTP. My code looks as follows:

Code:
Set v = DotNetFactory.CreateInstance("AutoTester", "C:\Projects\AutoTester\AutoTester.dll")

v.runUITest()

Now there is a little problem with loading this dll. It seems as if everything is working, however, when the test finished the dll file is still loaded by QTP. So I cannot delete/override the dll file. The file will only be released when I shut down QTP and restart it.

Is there a way of freeing the dll from within QTP?
"Set v = nothing" does not do the trick :/

I also have a second question (not related to this question):
Is it possible to start the VBScript from above from within HP Quality Center? So that I do not need to install QuickTest Professional?

Best wishes
Christian


RE: usage of custom dll's - Cassin - 10-19-2010

Christian,

I think you should just be able to use the v.close() option to close your DLL. I use the close method for lots of other things to close whatever I am using when I am done with it -- especially if I am running it in multiple iterations and need to time the opening and closing...o.O

At my current workplace they have not found a way to run QTP tests without having QTP on the workstation. You could, however, have a virtual workstation...that you access through Vbs that is not on a particular workstation and execute the test from there. In this case, you would not need to have QTP loaded. And there is a whole walk-thru on connecting QTP to QC in the QTP help files, if you need to do that.

Cheers.