Posts: 24
Threads: 10
Joined: Aug 2009
Reputation:
0
08-26-2009, 08:41 PM
Hi,
Is a function in QTP that will unload the previously loaded DLL.
Used Extern.Declare method to Load DLL.
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
08-27-2009, 10:21 AM
I dont think there is any method to unload the previously loaded dll.
You can unload the DLL in QTP by opening a new test. BTW what is the case when you need this, can you please explain?
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-27-2009, 12:11 PM
Saket is correct. There is no syntax/command to unload a DLL. If your intention is to re-compile your DLL then you may need to open a different test and navigate back to the same test.
Save the blemish...this is the way mercury choose QTP to work :-)
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 24
Threads: 10
Joined: Aug 2009
Reputation:
0
08-27-2009, 06:37 PM
Saket - FYI:
We have a DLL by the name KLLDLL32 which handles all the open sessions of the AUT when called.
This DLL is called after each test/script so that it can handle/close all the sessions of the application (several tests are run in the Batch mode).
So before each new test begins, DLL is called and it kills the application and then it is supposed to be unload and then a fresh Test begins.
Let me know incase you need more information w.r.t the same.
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
08-27-2009, 07:48 PM
Question -
1. how do you call each test? and when do you kill your application through dll.
2. why do you need a dll to kill your application, is this the way the AUT works? or any workaround?
If I am getting it right, You can have two options,
1. If it really requires to kill your test at the end of each test, You should open the AUT at the beginning of each test.
2. Do not call the dll after each test let all test finish then you may call the dll
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
08-27-2009, 08:47 PM
(This post was last modified: 08-27-2009, 08:52 PM by Saket.)
Hi Prabhu,
can you please post some lines of code from Kill_Application. I beleive there must be some function or object which is being called and closes application. if this is the case then it will be easy to manipulate.
Is there any issue that you can not re-open the AUT once killed?
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
08-28-2009, 10:21 AM
I guess you are trying to implement this particular script in QTP, in which you have Close_DLL function and you are not able to do that. Am I right?
in that case I can say dont bother for unloading the dll. once you open a new test QTP unloads the dll itself.
you can use the dll in your script wherever you need to kill the application, using Extern.Declare or createobject (whatever applicable)
Now whenever you need to Kill the application just call your function dll_Kill.
once your application is killed, You will have to reopen your Application to proceed further, for this check your application is open or not each time your test case begins and if not open it.
does this help?