closing a secondary "pop up" window

Asked by Hugh McSharry

I have been able to create a script that selects "Help" from the File Menu then selects "about" and it brings up the info bo for the program. At this point I try using the command type(Key.ESC) to close that info box but it doesn't close. It appears that the info box is no longer the primary window. How do I make that window the active window and have it accept the ESC command to close the info box.

As you can tell no one will ever confuse me with a programmer of any ilk. Any help would be appreciated.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

With the following script, I have no problem to achieve what you want (Win 7-32 german)

App("Firefox").focus() # switch to running FF
type('h', KEY_ALT) # open help menu
type('e') # select about/info
wait(3) # have a look at it ;-)
type(Key.ESC) # make it vanish
wait(2) # have a chance to see it

Revision history for this message
Hugh McSharry (hmcsharry) said :
#2

Hello again...

thanks a bunch for the script it has worked well but I am running in to problems again for no apparent reason. the script will run fine 2, 3 , 4 times in a row and then inexplicably stop working and always at the last step of sending the ESC key to close the "about" window? Rebooting the system doesn't seem to help.

thoughts..?

Hugh

Revision history for this message
RaiMan (raimund-hocke) said :
#3

It is hard to decide from the distance.

If the about-window does not close, it is either a timing problem (the type comes too fast, add a wait before), or the window lost focus somehow.

You might paste your script here.

Revision history for this message
Hugh McSharry (hmcsharry) said :
#4

The script is identical to what you were kind enough to provide initially. Only change is 'a' instead of 'e' to bring up the "about program" window and I took out the remark sections. Initially I had also removed the wait command.
I have added the wait command back in and it has successfully tested multiple times now. I guess I'll "wait" to hear from the end user. He's good at breaking things so if it gets by him I should be in good shape..

Thanks again for the help.

H.

Can you help with this problem?

Provide an answer of your own, or ask Hugh McSharry for more information if necessary.

To post a message you must log in.