Debugging Tests in UFT

Debugging Tests in UFT
----------------------

What is Debugging?

Locating and Isolating Errors thru Step by Step execution.

Application Life Cycle
------------------------
Development        Testing        Production
---------------------------------------------------
Error            Defect        Failure
Mistake            Bug
            Fault
-----------------------------------------------------
When debugging is required?

Test is not showing any errors and providing correct output - Debugging is not required

Test is showing errors - Debugging is Optional

Test is not showing any errors and Not providing correct output- Debugging is required
-------------------------------------------
How to Debug?

Using VBScript debug commands and breakpint we can debug tests
------------------------------------------------------------
VBScript Debug commands and Breakpoints
Step into (F11)
-----------------
a) It starts the Execution

b) It executes one statement at a time

c) If it is Function call it opens the function and executes one function statement at a time

Step Over (F10)
---------------
a) It executes one statement at a time

b) It executes all function statements at a time

Step Out (Shift + F11)
----------------------

It executes all remaining Function statements at a time

Breakpoint (F9)
------------------
To pause the Execution

---------------
Test Run / execution

i) At a time execution - Using UFT Run command

ii) Step by step execution - Using VbScript debug commands

iii) Hybrid execution - Using VbScript debug commands and Breakpoint
-------------------------------------------------------------------
Ex:
Dim a, b, c
a=10
b=20
c= a + b
a=5
b=7
c= a * b
Call Login("abcd", "mercury")
a=10
b=4
c= a ^ b
a=4
b=7
c= a / b
a=100
----------------------------------------
Debug Pane

It is used to debug Tests with help of VBScript Debug Commands

Advantages of Debug Pane

Watch Variables

Change values of Variables at Run-Time

0 comments:

Post a Comment