Web Testing running javascript code from page: can not access to members
Hello!
I am testing a web app in Edge. When I start the web app by myself in Edge, open the developer tools with F12 and go to the console, there I can call a member called 'allShapes'. The result is an array of shape objects that the application displays, containing additional information I need to check in my tests.
Following the instructions in https://support.smartbear.com/testcomplete/docs/app-testing/web/common-tasks/javascript.html#HowTo, I tried the following:
var shapes0 = pageObj.contentDocument.Script.allShapes;
var shapes1 = pageObj.contentDocument.Script.eval("allShapes;");
var shapes2 = pageObj.contentDocument.Script.$get("allShapes");
var shapes3 = pageObj.contentDocument.Script.eval("window.allShapes;");
var shapes4 = pageObj.contentDocument.Script.window.allShapes;
var shapes5 = pageObj.contentDocument.Script.window.$get("allShapes");
Unfortunately, all the shapes* variables are undefined.
When I look in the debugger, the contentDocument and Script objects are defined, however, allShapes and other members and methods I see in Edge's console are not visible.
What can be the reason for this? What am I doing wrong?
Thank you very much for your time!
PS: Using TestComplete 15.31.374.7. The application in question is written with Angular.