Forum Discussion
- AlexKaras
Champion Level 3
Hi,
In 99% of cases when the tested application does not provide unique identifiers for controls and you cannot convince developers to add them, you are out of luck and the only way is to use the Index (third attribute of the .Window() method) to distinguish between different controls of the same class.
(Yes, this may be fragile depending on your tested application. But may appear to be quite stable if application's UI is stable as well.)
For the remained 1%, depending on your tested application, you may consider:-- To implement some euristic when, say, you will search for some label and then search to the right of it for the Edit control;
-- Try to use Required Child functionality in NameMapping (though I am far not sure that edit boxes have any child objects);
-- Play with the new OCR functionality in TC 12.60 Beta (https://community.smartbear.com/t5/TestComplete-General-Discussions/TestComplete-Beta-Program-Try-AI-Driven-Visual-Testing/td-p/168632) and see if helps.