Forum Discussion

Raj123's avatar
Raj123
Occasional Visitor
6 years ago

Not able to find unique properties in the desktop application,where app is developed using VisualC++

Not able to identify the unique property and add it as object, because all the text boxes in the window are showing Edit boxes, does not have any specific names

 

The object's full name shows like below

 

 

When one element is added into name mapping, for other element also its showing previous ones name and notallowing it to add, saying like element is already exists

1 Reply

  • AlexKaras's avatar
    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.