troubleshooting with qtp

19

Upload: praveen-gorantla

Post on 18-Nov-2014

676 views

Category:

Education


0 download

DESCRIPTION

Troubleshooting with QTP

TRANSCRIPT

Page 1: Troubleshooting with QTP
Page 2: Troubleshooting with QTP

What is Troubleshooting? How to Troubleshoot? Debugging

Step Commands Pausing a Run Session Setting Breakpoints Removing Breakpoints Using the Debug Viewer

Session Wrap-Up

pgorantla.blogspot.com

Troubleshooting with QTP

Page 3: Troubleshooting with QTP

While working on software applications the user generally faces conditions whereby the operation performed on concerned application comes to a stall due to certain error that occurs in the process.

It becomes necessary to identify these conditions and corrective measures are taken to avoid these conditions for proper flow of the test run.

In QTP we have the Debug Viewer that helps to find the exact location of occurrence while running the test and also in loop structures.

One of the troubleshooting technique available in QTP is Recovery Scenarios as this helps in maintaining the flow of test run.

pgorantla.blogspot.com

Troubleshooting with QTP

Page 4: Troubleshooting with QTP

pgorantla.blogspot.com

Troubleshooting with QTP

Page 5: Troubleshooting with QTP

pgorantla.blogspot.com

Troubleshooting with QTP

Page 6: Troubleshooting with QTP

pgorantla.blogspot.com

Troubleshooting with QTP

Page 7: Troubleshooting with QTP

pgorantla.blogspot.com

Troubleshooting with QTP

Page 8: Troubleshooting with QTP

In QTP you have the option of the Debug viewer which also helps in finding the conditions where error can occur.

The user can run the test in the debug mode by using the F11 key.

This helps to check smooth run of the created test, without errors in syntax or logic.

This can also carried out by inserting breakpoints within the test.

This makes use of the Step commands which are; Step Into: Used to run only the current line of the active test or

component. Step Out: Used only after using Step Into to enter a action. It runs to

the end of the called action, then returns to the calling action and pauses the run session.

Step Over: To use this option either click Debug > Step Over button, or press F10 to run only the current step in the active test or component. pgorantla.blogspot.com

Troubleshooting with QTP

Page 9: Troubleshooting with QTP

Pausing a Run Session You can temporarily suspend a run session by choosing Debug > Pause

button. A paused test or component stops running when all previously

interpreted steps have been run.

To resume running a paused test or component, choose Test > Run or Component > Run. The run continues from the point it was suspended.

Setting Breakpoints By setting a breakpoint, you can stop a run session at a pre-determined

place in a test or component.

You can use breakpoints to: suspend a run session and inspect the state of your site or application mark a point from which to begin stepping through a test or component using

the step commands

To set a breakpoint choose Debug > Insert/Remove Breakpoint, press F9.

Removing a Breakpoint To remove all breakpoints, choose Debug > Clear All Breakpoints/F9.pgorantla.blogspot.com

Troubleshooting with QTP

Page 10: Troubleshooting with QTP

The Debug viewer pane can be used to view, set, or modify the current value of objects or variables in your test or components.

The Debug Viewer pane is positioned below the Data Table and Active Screen.

The Debug viewer tabs are used to display the values of variables and objects in the main script of the current action, or in a selected subroutine.

The Debug viewer consists of three different tabs namely; Watch Expressions Tab Variables Tab Command Tab

pgorantla.blogspot.com

Troubleshooting with QTP

Page 11: Troubleshooting with QTP

Watch Expressions Tab This tab to view the current value of any variable that has an

expression assigned to it. If the value of the object or variable changes when you

continue to run the test or component, the value in the Watch Expressions tab is updated.

Variables Tab Use the Variables tab to view the current value of all

variables, in the current action or selected subroutine, identified up to the point where the test or component stopped.

If the value of a variable changes when the run continues, the value in the Variables tab is updated.

Command Tab Use the Command tab to execute a line of script in order to

set or modify the current value of a variable or VBScript object in your test or component.

When the run continues, QTP uses the value that you set.pgorantla.blogspot.com

Troubleshooting with QTP

Page 12: Troubleshooting with QTP

Scenario

User runs a multiplication program. It has an expression for the intresult variable which the user inserts in the Watch Expression tab and the corresponding values for this variable goes on incrementing as the program is executed. The initial value for the being 1 and the final value being 15.

pgorantla.blogspot.com

Troubleshooting with QTP

Page 13: Troubleshooting with QTP

Scenario

For the same program if we try to check the variable tab in the Debug Viewer we get the all the variables that have been used in it inserted. The values for these variables keep on changing while the program gets executed. The initial value for intCnt, intSubcnt and intresult all have their initial values as 1 and the final value being 3, 5 and 15 respectively.

pgorantla.blogspot.com

Troubleshooting with QTP

Page 14: Troubleshooting with QTP

Scenario

While running the script the amount of time taken to load an particular page is more than the estimated time hence the corresponding error occurs stating that the object cannot be found.

Possible Causes

As stated in the above conditions, this error can also occur if the property value has changed for that object.

But over here if you observe then in the Active Screen we see “Page cannot be displayed” error which occurs if the corresponding page is not loaded or the server has timed out.

pgorantla.blogspot.com

Troubleshooting with QTP

Page 15: Troubleshooting with QTP

pgorantla.blogspot.com

Troubleshooting with QTP

Page 16: Troubleshooting with QTP

Scenario

While running certain scripts if parameters are not properly declared in the script then we get the error given below.

Possible causes

This can be a case where in the Keyword View the parameter is not set and the script is run.

In the Expert View if the parameter is not defined but called upon in the script.

The expressions used are improper.

It becomes necessary that the user uses breakpoints or debugs the script where he has defined certain variables or has certain expressions declared initially before running the script as this will help him reduce the error.

pgorantla.blogspot.com

Troubleshooting with QTP

Page 17: Troubleshooting with QTP

pgorantla.blogspot.com

Troubleshooting with QTP

Page 18: Troubleshooting with QTP

pgorantla.blogspot.com

Q & A….

Troubleshooting with QTP

Page 19: Troubleshooting with QTP

Troubleshooting helps the user to identify the glitches while operating with QTP.

Debugging helps to identify the exact location where the glitch has occurred.

Debug viewer has an option to change the values for the variables used in the test.

pgorantla.blogspot.com

Troubleshooting with QTP