← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #162372]: Best way to code closing a browser(app) triggered after a complete windows copy event

 

Question #162372 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/162372

Description changed to:
I'm trying to figure out what is the best way to code this set of
events: ( windows environment, running FireFox )

-after executing a web application (report), wait for report to finish, then:
Perform a File > Save Page As > newfilename > Save > close Firefox

So far I have it working with this code starting at the waiting of the
report:

wait(50)  --high to give me time if needed for a slow report
click(File.png)
click(SavePageAs.png)
exists(FilenameBox.png,0)
paste("MyNewFile")
type(Key.ENTER)
wait(5.0)
exists(SaveButton.png), 0)
click(getLastMatch())
wait(30.)
closeApp("Firefox")
closeApp("cmd")

Intermittent issues so far:
-Sometimes when it saves the file, it takes sometime to finish the copy of the file to a remote folder. Firefox pops up a window and shows copy progress of my "MyNewFile" to its target folder.
-So if it takes long or passes my wait(30) threshold, it will then close the app before I need it too

I would like to make it more robust where I am waiting for the copy to finish. Should I be capturing that window?
What is a good way to handle this event? Once I know the copy is done using Firefox, then I want to close the app.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.