Forum Discussion

GTayal's avatar
GTayal
Occasional Contributor
6 years ago

AngularJS framework implemented with no unique Id or name mapping for objects

Our Dev team recently implemented Angluar JS for a new application and they are not using any Unique IDs or name mapping for objects/web elements.   With TestComplete, I am unable to identify any...
  • charleshb's avatar
    6 years ago

    We had a similar requirement recently and I found that only DIVs and standard HTML and CSS tags and attributes  are identified in TC-14 object browser by default. On these objects that are identified, you need to check the Properties of the objects like tristaanogre advised.

    Also custom data attributes are a helpful thing to look at as cunderw said.

     

    Note that TestComplete either uses the "id" attribute or the "name" attribute to identify the web objects by default on DIVs.

    see Tools -> Current Project Properties -> Open Applications -> Web Testing -> Object Identification 

     

    Also, for proprietary UI controls and Angular JS controls, you need to have support within TestComplete to use special tags and attributes to identify objects.

    see Tools -> Current Project Properties -> Object Mapping

    For example for DevExpress it's here: https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/controls/devexpress.html

    Supported Browser Versions IN TEST COMPLETE 14

    https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/controls/angularui.html

     

    Additionally, you can get any custom HTML elements to be idenfitied - otherwise placing IDs on them won't help.

    For this, refer to TestComplete Web - working with custom elements

     see Tools -> Current Project Properties -> Open Applications -> Web Testing -> Custom Attributes 

     

    In any case, you really have to get back to the DEV team and if required have a live session with them to show that you are not able to identify their objects for automation testing. And if you can try to get them to add the IDs on DIVs at the least that's a good point to start.

     

    (And the first image you shared: The panels are all DIV tags in the page, as far as I remember. Note that using "Extended Find" feature is very helpful and necessary when doing the NameMapping - because the tree of the DIV tags cannot be guaranteed in a web application generally.)