08-23-2010, 11:17 AM
Hi Prabhat ,
I don't think so its a good idea to identify objects using there Tag names.
Let's take your scenario , suppose if i add another Java button into your application with name say "Button1" we have two Java buttons with the same name in that case your script fails because there is no additional property mentioned to uniquely identify the object hence it becomes ambiguous for QTP to understand what has to be done and on what object , so u have to use a property which is unique across objects and index is one among them. And the reason why you are getting this error "there are more than one objects satisfying the criteria" might be because QTP is intelligent enough to identify that the object property you have mentioned is not going to be unique for a long time , i am not sure of the exact cause though. Let's wait for others comments.
I don't think so its a good idea to identify objects using there Tag names.
Let's take your scenario , suppose if i add another Java button into your application with name say "Button1" we have two Java buttons with the same name in that case your script fails because there is no additional property mentioned to uniquely identify the object hence it becomes ambiguous for QTP to understand what has to be done and on what object , so u have to use a property which is unique across objects and index is one among them. And the reason why you are getting this error "there are more than one objects satisfying the criteria" might be because QTP is intelligent enough to identify that the object property you have mentioned is not going to be unique for a long time , i am not sure of the exact cause though. Let's wait for others comments.