Forum Discussion
also what is the difference between Ovelappin window and Unexpected Window Event. when i keep both..my issue is getting solved
Hi,
Both OnOverlappingWindow and OnUnexpectedWindow events occur only when test code tries to interact with some UI element via the mouse or keyboard like the human user do. Events are not triggered if the test code just gets or sets some properies of the UI element. For example
window.Caption = "My modified caption"
line of code will never trigger these events because there is no interaction with the window here.
OnUnexpectedWindow event is triggered when test code tries to interact with some target UI element and this element (or the point that test code tries to interact with) is blocked with some other window in a way that this target UI element can not be activated or focused. Usually, those blocking windows are system modal or application modal message boxes.
As an example, if test code tries to execute
window.editBox.Keys("Hello world")
line of code which requires the window object to be activated (i.e. put in front of all other windows) and the editBox control to be focused, the OnUnexpectedWindow event will be triggered if the above actions cannot be performed because of system modal or application modal message box displayed.
OnOverlappedWindow event is triggered when test code tries to interact with some target UI element and this element (or the point that test code tries to interact with) is overlapped with some other window or control but this overapping control is not a modal one, but just overlaps the target control.
The baisc difference - in case of modal window, the blocked control cannot get focus until the blocking modal window is closed. In case of overlapping window - the blocked control can get focus without blocking window to be closed.
Hope this makes things to be more clear...
- tmahender129 years agoFrequent Contributor
thanks for your reply, but i could not click on the unexpected window using regular process, iam using Alt+F4 to close unexpected window, is there any other method for handling these windows
- AlexKaras9 years agoChampion Level 3
Hi,
> i could not click on the unexpected window using regular process
Why? Could you provide more details on what and how you are trying to do?
In the worst case, if the window can be closed only using Alt-F4 shortcut, then you can close it from the event handler using
window.Keys("~[F4]")
line of code, where 'window' variable references target unexpected window and is provided as one of the parameters for the OnUnexpectedWindow handler.
Related Content
- 10 years agoneha_sharma
- 7 years agoVarunawasthi