Forum Discussion

luke_jones's avatar
luke_jones
Occasional Contributor
12 years ago

AngularJS Help/support

Our development team have adopted angularJS for their most recent projects. Mostly this doesn't cause any issues with Test Complete. However I have found one instance which is a problem. 



AngularJS has a directive called data-ng-include which allows the user to specify a HTML file which can be injected into the page. We're using this for modal pop ups. Rather than have all the code for the popup in the main html file, the directive is used to load it when needed. 



This causes a problem with Test Complete when trying to map objects on the pop up as they're not in the same DOM as the other objects on the page. 



Any ideas on a solution? 
  • luke_jones's avatar
    luke_jones
    Occasional Contributor


    We switched to using Angular-UI modal's which inject the HTML in a slightly different way, but also we have moved to mainly using the QuerySelector method to find and action page objects. 



    We use name mapping to map the page element and then use create objects off that e.g. 



    var base = Aliases.browser.myPage; 



    base.querySelector("#myButton").click(); 


  • dhill_1's avatar
    dhill_1
    New Contributor
    Are you able to click on an object that is not a button using that method? I have an array of objects dynamically created that I want to click on one of those objects using TestComplete.