PROBLEM:
Unable get the SAP Interface's dynamic window 'Close Popup' action
to work. The 'Close Popup' action fails to close
the popup window. How do I make this work?
SOLUTION:
In Certify, a Dynamic Window is a window which has not been
"learned" and therefore does not have a named Map recorded in the
Certify database. To interact with a Dynamic Window (modal or
non-modal) requires that we first get Certify to be "in context" with
that window; meaning that Certify has found the window and associated
an internal window handle with the window dynamically. This is
accomplished using the Dynamic Window object's Find action. Once the
window context is found, Certify can work with that window using the
dynamic window actions because it now has a concrete reference to the
window.
EXAMPLE:
Suppose you have a popup window which appears with the name "SAP"
in the Title bar. As far as Certify's dynamic window functionality is
concerned, which SAP window {wnd(0), wnd(1), or wnd(x)} is visible or
has focus is completely inconsequential. You could use the HTML
Interface Active Window's "Send Keys" action to send the "{Esc}" key.
However, to be completely sure that you are closing the correct popup
window, you would use the Dynamic Window object's Find action to find
the window named "SAP", then call Close Popup on it. If you just use
the HTML Interface Active Window's "Send Keys" action to send the
"{Esc}" key, then you will be closing whichever window is active. If
the "SAP" window did not pop up for some reason, you would end up
closing your main SAP screen and all subsequent steps would fail.
Instead, you should use the two step Dynamic Window method to ensure
that you consistently close the desired window and not some other one.