Tuesday, 27 August 2013

QTP Basics Part2: Recording modes:Analog Mode

Recording Mode Continued....

Analog Mode: This mode enables user to capture exact mouse movement and the action performed.
For an example if you are gonna click on submit button.It wont capture the submit button and the properties of the object ,instead it will capture the co-ordinate movement and the action performed .So it will capture the info that the a click action is performed at the location.(300,468).
Now again this mode has some drawbacks

Once the a script is recorded with analog mode , we cant edit the Analog Recorded Steps within the QTP.

Steps to use Analog mode:

1. Click on the Red recording button, as in Normal recording mode.
2. once the recording is started . Click on mouse like icon as shown in below screen shot.
Please notice this button is disabled by default.Once we click on the recording button then only it will be enabled.

3. After clicking on the analog Mode recording button. A new window will be    displayed with analog recording options as shown in below snapshot.This has two option.the first option lets QTP capture co-ordinates with reference to the screen itself.
If you want to make QTP store the script capture relative to any specific window(And yes this is more reliable, because you can run several window in this case and those wont conflict )SO it is good practice to use the second option and store analog mode for relative screen capture.(Click on the hand button to specify the window)
4. Once the Proper option is selected, click on the Start Analog Record.
5. perform the action you need to perform and record

6.After recording is done. Click on the stop recording button.

Now Please notice you have received just a one line of statement,instead of multiple line of code specifying each step like in Normal Recording Mode.It just shows a call statement for Analog Capture function, which store the entire story covered till now.
This statement may look as 

Desktop.RunAnalog "Track2" 

And yes we cant see the content of "Track2" .Actually the RunAnalog is a QTP Defined function
which stores the reference of the information storage of the screen capture.(This is similar to
references for checkpoints and sync keywords, but more on those will come in later posts)
And this is the reason we cant modify the steps recorded by Analog method.

Till you I believe you might have noticed that isn't very good technique for scripting as ,in real word 
scenarios You will need to modify the recorded step to a certain extent which is impossible in this 
approach. So advise is to use this   approach for very elementary steps(to capture a couple of basic
operation provided Normal mode is not working for that screen.) and continue rest of the code 
through normal mode.

Hope this Helped....

Please comment for any queries/suggestions regarding the above posts.

No comments:

Post a Comment