| || |
Descriptive Programming - unique identification
OK, I'm starting to crawl a little with descriptive programming. Here's a 2-line snippet from my script:
Browser("title:=xxx").Page("title:=xxx").Image("fi lename:=OM_CreateNewOrder.gif,src:=%OM_CreateNewOr der.gif").Click
When QTP runs this script, it tells me that there are more than one objects that match the criteria I am using. Huh? I used the Spy utility to look at the properties of each image and didn't see more than one image with this name. I added the constraint "Visible:=True" in case there was an invisible one out there somewhere, but got the same result.
I can't seem to use the "View Code" option in IE when QTP has its hooks in the browser, so I shut down QTP and the AUT, then restarted it. In the HTML code was only one instance of the above referenced file.
How or why is QTP seeing multiples? Is there a not-so-obvious property I can use to distinguish between the objects? I'd rather not use X/Y position or other properties that are dependent upon resolution.
Thanks. This forum has been helpful and maybe some day I will be at the point where I can reciprocate.
This gets weirder
OK, so I tried
And still get the same error. Somehow QTP thinks there are 2 images at the same location, or rather the same X location. Might my app be rendering the image to the screen multiple times? If so, is the "Z order" and option? Or maybe an Index? OK, I'll continue to experiment but hopeful someone has been down this road before.
Re: This gets weirder
Add the ordinal identifier of index 0 to click 1st occurance, 1 to click 2nd occurance tec.