|
Meir Bar-Tal
|
 |
« Reply #1 on: November 09, 2008, 12:27:08 AM » |
|
I apologize for the time it has taken to answer this question. We must have somehow missed it.
Now, To the point.
Well, I've had experience with such identification problems (in a Web application, though, but it's the same trick).
The problem stems from the fact that the developers don't provide a unique id for each object; in Web it would be a nsme or html id, in Java it woukd be a tag (or attached text, or whatever). The problem you're describing with the indexes is a genuine one.
Now to the good news.
I solve such problems thinking out of the box. My assumption is that in such a case we need to imagine how a human user would perform the task (after all, he/she doesn't know the object id, even if it exists). So, you need to think about the static text beside the JavaEdit as if it were attached text. That is, it's an object that appears on the left side of the required JavaEdit. What I do in such a case? I get two collections of objects (similar to what you've suggested) one for the statics and one for the JavaEdits. Then I loop through the static collection, and check for the text of each object. If it fits the label I'm looking for, then I take the X/Y coordinates and width, and look for another JavaEdit in the other collection that is at about the same height (Y coordinate) and to the right of the static (X+Width).
This way I can identify the objects dynamically, as if a human eye would scan the screen and spot the label to lead the hand to move the mouse to the field just next to the right.
I hope this is clear. If you'd need more help, don't hesitate to apply.
|