hlalumiere
12 years agoRegular Contributor
Unclear statement in documentation regarding OnUnexpectedWindow event...
I am currently in the process of designing a better handler for unexpected windows in our test suite. Reading the documentation here, it is stated:
"If you simulate a mouse click within the
So, how exactly am I supposed to handle an unexpected window, if I cannot click any of its buttons without triggering my handler again? Will it perform the click, close the window and THEN call the handler? In which case I just have to check if the Window parameter of the handler is nothing?
This is all pretty confusing, I don`t seem to see the usefulness of recursivity in this particular case. It seems to be twisted and convoluted just for the sake of it.
As a reference, what I intend to do is fetch the buttons configuration of the particular dialog that triggered the event, fetch the caption in the dialog, compare the dialog and buttons selection to a database table, and retrieve the appropriate default answer for the particular dialog. Then click that button and have the test moving forward again like nothing happened.
"If you simulate a mouse click within the
OnUnexpectedWindow
event handler, TestComplete will check for an unexpected window (that is, the event handling routine will be called recursively)."So, how exactly am I supposed to handle an unexpected window, if I cannot click any of its buttons without triggering my handler again? Will it perform the click, close the window and THEN call the handler? In which case I just have to check if the Window parameter of the handler is nothing?
This is all pretty confusing, I don`t seem to see the usefulness of recursivity in this particular case. It seems to be twisted and convoluted just for the sake of it.
As a reference, what I intend to do is fetch the buttons configuration of the particular dialog that triggered the event, fetch the caption in the dialog, compare the dialog and buttons selection to a database table, and retrieve the appropriate default answer for the particular dialog. Then click that button and have the test moving forward again like nothing happened.