Identifiying UI components
What I want to do is:
1. Launch an existing application (mainly AWT) and mark a specific UI component (say, a button).
2. Launch the same application again and be able to identify the same UI component and do something to it (say, change background color).
The way to indentify an UI component is by the context of the component so at (1) I will save the context of the component and on (2) I will check if the saved context appears in the current screen- if so I want to say that the UI component is identified.
The context that I thought to save is the parents chain of the UI component and some of their attributed (some that are consistent throughout all runs of the application).
Now for my questions :)
1. What attributes may I really on?
2. Is it enough context? (saving the parents chain and attribute) or may it cause in (2) to indentify components that I didn’t intended to?
3. What other context should I use?