sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #03522
[Question #162372]: Best way to code closing a browser(app) triggered after a complete windows copy event
New question #162372 on Sikuli:
https://answers.launchpad.net/sikuli/+question/162372
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 0> 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.