Wednesday, March 20, 2013

Debug option in QTP



Debug Options in QTP

  1.    Debug viewer- to see the debug details
  2.    MSGBOX function to display value of variable
  3.    Exist method to check control exist or not
  4.   GetLastError & DescribeResult- to see the error code and description
  5.   Run to Step and Run From Step – to run the test from particular step
  6.  QTP breakpoints- using it user can stop the execution and see the status of application, change the code etc
  7. Step into, step out and Step over


Syntex error
QTP checks syntax when you switch from expert view to keyword view.
Tools> check syntax (Ctrl + F7)
Syntax error shown in information pane having detail, item, action and line number.
GetLastError & DescribeResult
GetLastError returns the error code of the most recent error. You can use this statement together with DescribeResult statement. DescribeResult returns text description of the specified error code.
Window(“abc”).Activate
X=GetLastError
Msgbox (DescribeResult(x))
 


2 comments: