My Blog List

Sunday, August 19, 2012

QTP - Common error messages

Always I am seeing  many of my friends asking for help if any error occurs while running script in QTP without googling for help. How much troubleshooting you guys are doing will directly reflect your knowledge on the tool. I agree, no one knows each and every error occurs in the software. But we can improve our knowledge by googling and doing workarounds...
Whenever the question "How much level you know QTP?" arrows me, always I am comfortable with the answer "below 10%". But after answered, my mind will have an inner thought like, What are the things I have to learn to fulfill the answer I have told because I never used lot of features in QTP.

Here I am listing out some of the errors, situations and what might be the original issue things etc. I hope this will give you some ideas to improve your debug ability and to solve your errors. Kindly correct me If I am wrong in any point.

Type mismatch:
- Mostly doing operations with different data types without doing type conversions
- Whenever the mentioned object or function not available in the code with respect to QTP knowledge. You might forgot to associate the function lib or renamed of the function.

Parameter is Incorrect:
- The data to be inserted or set in the object will have extra length. i.e. above the design limit of the test object.
Ex. Mostly while setting some value in edit box, we will get this error because we are trying to set the value with 50 chars in the edit box designed to handle max 30 chars.

UnExpected ):  
- Mostly fresh QTP coders will see this error. Whenever trying to call a function, use parenthesis only if you are going to get the returned value from the called function. 
- If you are not going to get the return value, then just mention your parameters without using ().

No. of parameters mismatch:
- Here you could have missed to mention all the parameters for your function.

More than 1 object is matching...:
- Here QTP identifies more than 1 object with the mentioned properties and got confused which one to handle. You need to give additional properties to identify your object uniquely. Sometimes index will give you hand.

Out of bound error:
- When you are trying to get the values from an array position which is not declared or assigned or not available.

Name undefined:
- You should have mentioned Option Explicit to force the variant declaration but you forgot to add the declaration for the variant.

Name redefined:
You should have mentioned Option Explicit to force the variant declaration but you declared the variant which is already declared.

Object Required:
Sometimes we will try to get an object from long hierarchy if its not identifiable easily. At this time, if any mid way object is failed in identification, QTP will throw this error.
Ex. While trying to get the object inside the WebTable, QTP will throw this error if webtable itself not identified.

General Run Error:
- Say you have function in your vbs file like Function abc(a,b) and from your test you are trying to call like If abc(a) Then. Here QTP will raise this type of error.
- And also some places where QTP not able to identify which type of error.

I will keep adding the errors I have faced and known to my knowledge. Definitely every one will face lot of errors. Kindly share the same here so that I will add those too for every one's reference.

2 comments:

  1. Ahh…finally, after so much of scavenging…here it is...I have been desperately looking for this info from past few months…I am sure this would help me a lot…..I never thought the solution for my nagging question is so simple…Or probably you are damn intelligent to explain such a complicated thing in a simple way..Thank you again!!
    Automation

    ReplyDelete
  2. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium

    ReplyDelete