Forum Discussion
dfarr
11 years agoOccasional Contributor
Ruben,
Although you have solved your problem, I can't help think that your problem was similar to one I struggled with. If so, you might find this helpful or interesting.
Our browser application is developed in AngularJS. I use FindChild and a keyword-to-property/value mapping for object acquisition in my scripts. (Not TestComplete’s Name Mapping and Aliasing).
In our AUT, a button click would open a dialog (“Panel”/Div/modal class) whose existence and visibility I wanted the automated script to validate.
When the dialog was open, Object Spy reported its visible and visible-on-screen properties as true. But when the script ran and opened the dialog, it reported the dialog as not visible and returned a failure. When running the script in debug mode, inspection of the dialog object after it was acquired showed its visible properties to be false, even though object spy reported these as true. It was not a timing/synchronization issue.
Why did findchild at runtime report the dialog as not visible while Object Spy reported as visible?
I cracked open the html with firebug in Firefox and saw this: There were 4 instances of the dialog, and 3 of them were grayed-out. That is, every time the dialog was opened and closed, the html code for the object remained, but only one of them was “active”. Object Spy saw the active instance, but findchild happened to find one of the 3 “inactive” instances. So, a little more exploration allowed me to find an attribute that could distinguish the “active” instance from the others and the simple addition of a property and value to the mapping allowed findchild to acquire the active instance and the problem was solved.
I wonder if you were facing the same condition and hope this long response was at least interesting. :-)
@ Andrey: Thanks for that suggestion; that may be handy sometime.
Although you have solved your problem, I can't help think that your problem was similar to one I struggled with. If so, you might find this helpful or interesting.
Our browser application is developed in AngularJS. I use FindChild and a keyword-to-property/value mapping for object acquisition in my scripts. (Not TestComplete’s Name Mapping and Aliasing).
In our AUT, a button click would open a dialog (“Panel”/Div/modal class) whose existence and visibility I wanted the automated script to validate.
When the dialog was open, Object Spy reported its visible and visible-on-screen properties as true. But when the script ran and opened the dialog, it reported the dialog as not visible and returned a failure. When running the script in debug mode, inspection of the dialog object after it was acquired showed its visible properties to be false, even though object spy reported these as true. It was not a timing/synchronization issue.
Why did findchild at runtime report the dialog as not visible while Object Spy reported as visible?
I cracked open the html with firebug in Firefox and saw this: There were 4 instances of the dialog, and 3 of them were grayed-out. That is, every time the dialog was opened and closed, the html code for the object remained, but only one of them was “active”. Object Spy saw the active instance, but findchild happened to find one of the 3 “inactive” instances. So, a little more exploration allowed me to find an attribute that could distinguish the “active” instance from the others and the simple addition of a property and value to the mapping allowed findchild to acquire the active instance and the problem was solved.
I wonder if you were facing the same condition and hope this long response was at least interesting. :-)
@ Andrey: Thanks for that suggestion; that may be handy sometime.
Related Content
Recent Discussions
- 5 days ago
- 5 days ago