Custom Web Objects Recognition (TC10 + Angular)
Hi.
I have been using TCs for couple of years from TC6 to TC9. I am now trying to understand if TC10 might help us to perform web testing over angular MVVM applications...
I have been looking over support but could not find that much information. Only two thread have been created here...
I have difficulties to identify angular web elements within TestComplete. I would rather avoid using script to enable TestComplete full support of custom property.
For instance, angular provides a directive ng-repeat that will generate following HTML code :
<div ng-controller="simplePiecesController" class="pieces-list ng-scope"> <!-- ngRepeat: piece in pieces --> <div class="ng-scope" ng-repeat="piece in pieces"> <div class="piece-form" max-documents-authorized="maxDocumentsAuthorized" validate="savePersistence()">First piece</div> </div> <!-- ngRepeat: piece in pieces --> <div class="ng-scope" ng-repeat="piece in pieces"> <div class="piece-form" max-documents-authorized="maxDocumentsAuthorized" validate="savePersistence()">Second piece</div> </div> <!-- ngRepeat: piece in pieces --> <div class="ng-scope" ng-repeat="piece in pieces"> <div class="piece-form" max-documents-authorized="maxDocumentsAuthorized" validate="savePersistence()">Third piece</div> </div> </div>
I am trying to achieve custom object identifying. If I manage to changed HTML to something like this (see following code), is there any chance I could have TestComplete to identify each of my divs ?
<div ng-controller="simplePiecesController" class="pieces-list ng-scope"><br> <!-- ngRepeat: piece in pieces --> <div class="ng-scope" ng-repeat="piece in pieces" ng-reference="first-piece"> <div class="piece-form" max-documents-authorized="maxDocumentsAuthorized" validate="savePersistence()">First piece</div> </div> <!-- ngRepeat: piece in pieces --> <div class="ng-scope" ng-repeat="piece in pieces" ng-reference="second-piece"> <div class="piece-form" max-documents-authorized="maxDocumentsAuthorized" validate="savePersistence()">Second piece</div> </div> <!-- ngRepeat: piece in pieces --> <div class="ng-scope" ng-repeat="piece in pieces" ng-reference="third-piece"> <div class="piece-form" max-documents-authorized="maxDocumentsAuthorized" validate="savePersistence()">Third piece</div> </div> </div>
I would like to use NameMapping, but unfortunately, TestComplete Object Spy wont let me access this ng-reference custom property... And I can't find any documentation about extending Object property without dealing with SDK !
I don't want to use NameMapping hierarchy since it might change often and is kind of dynamic... I would rather use extend find property... Furthermore, I don't want to force developers to add ID or Class property (since it is not angular philosophy) !
Any help would be greatly appreciated !
Best regards,
Guillaume.