Forum Discussion
You could use the "OnUnexpectedWindow" event handler... but I prefer your method...it's not an "unexpected window", you're expecting it and you need to execute the proper code...
Dear tristaanogre,
Thank you, Actually I am trying to check the pop-uped window buttons i.e Yes, No and Close. if I click No or Yes or Close Button the pop-uped window has to be closed and basing on the button clicked the main editor will perform according to that action.
What I am trying to do is , if it fails it will generate error and pop-uped window will not be closed. So, I am trying to close these pop-uped windows and continue the tests.
Did you get my point now ?
can I use these windows as "OnUnexpectedWindow" for fail cases ?
thanks and regards
SivaKartheek Sreeram
- tristaanogre6 years agoEsteemed Contributor
Most windows will also support the "Close()" method or something similar. Examine the window in Object Spy and see if there is a close method associated with it. That's what I would attempt to use on a fail... you'd need that anyway in the event handler... but I don't think the event handler is what you should use for this situation.
- sivakarthik6 years agoContributor
Dear tristaanogre,
Thankyou, even I have used the same thing in my routine.
For example: Close button test , if I click on the close button and satisfied the conditon it's fine but incase it not satisfies then I can't use the obj.Close() options right.
Rough Code:
if action == '"close":
if not obj.Exists:
Log.CheckPoint()
else:
Log.Error()
obj.Close() ## Here I can't use the same option which I am checking right ?
elif action == "no"
if not obj.Exists:
.......................
..............................
..........
Did you get my point now ?
thanks and Regards
SivaKartheek Sreeram
- tristaanogre6 years agoEsteemed Contributor
Yup, got the point... my answer does not change. I think you're handling this the best you can.
Related Content
Recent Discussions
- 3 days agovladd1