Google News
logo
QTP/UFT - Interview Questions
What are the types of error need to be handle in UFT?
There are various ways of handling errors in QTP. There are three possible types of errors, one would encounter, while working with QTP. They are :
 
* Syntax Errors
* Logical Errors
* Run Time Errors
 
Syntax Errors : Syntax errors are the typos or a piece of the code that does not confirm with the VBscripting language grammar. Syntax errors occur at the time of compilation of code and cannot be executed until the errors are fixed.
 
To verify the syntax, use the keyboard shortcut Ctrl+F7 and the result is displayed as shown below. If the window is not displayed one can navigate to "View" → "Errors".

Errors
Logical Errors : If the script is syntactically correct but it produces unexpected results, then it is known as a Logical error. Logical error usually does not interrupt the execution but produces incorrect results. Logical errors could occur due to variety of reasons, viz- wrong assumptions or misunderstandings of the requirement and sometimes incorrect program logics (using do-while instead of do-Until) or Infinite Loops.
 
One of the ways to detect a logical error is to perform peer reviews and also verify the QTP output file/result file to ensure that the tool has performed the way it was supposed to do.
 
RunTime Errors : As the name states, this kind of error happens during Run Time. The reason for such kind of errors is that the script trying to perform something is unable to do so and the script usually stops, as it is unable to continue with the execution. Classic examples for Run Time Errors are −
 
* File NOT found but the script trying to read the file
* Object NOT found but the script is trying to act on that particular object
* Dividing a number by Zero
* Array Index out of bounds while accessing array elements
Advertisement