Wednesday

Why do we need to launch the application under test (AUT) after QTP is launched?


Have you ever wondered why do we need to launch the application under test (AUT) after QTP is launched?
When I started learning QTP I asked the same question to the trainer and he said he would get back on it, after some research i found the answer to my question , sharing here what i learnt ( few years back ) and found ( recently ) :
  • QTP interacts with test applications using windows hooks.
A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure.
  • Therefore these hooks help QTP during recording and identifying objects
  • Hooks can only be installed using DLLs
  • These Hooks can be injected only during runtime when QTP is brought up.
An interesting example from Tarun here :

"Hooks are basically interceptors in system". This example will clear it

User Clicks -> Windows OS determine which Application should get it -> Sends the click to the application.

Now hooks allow to intercept the message and take action accordingly

User Clicks -> Windows OS determine which Application should get it -> Installed Hook (Hook can decide to send the message or cancel it or record it or take some action based on event)->Sends the click to the application.
Happy Testing!

No comments:

Post a Comment