Am new to the forum and to scripting, so please be gentle! :mrgreen:
I’m using eggplant to track down a crasher in our file–>open routine. Basically, what I want to do is alternate between two files until the app crashes, and email me on the iteration that crashed. My first attempt was the following:
repeat 20000 times if imagefound(someimage) then typecommand "O" typecommand "D" click "file1" typecommand "W" if imagefound("Mac/DontSave") then typetext "d" end if typecommand "O" typecommand "d" click "file2" typecommand "W" if imagefound("Mac/DontSave") then typetext "d" end if else SendMail (to:"me@myCompany.com",subject:"Crash!",body:"The application crashed after "&repeatIndex()&" times") end if end repeat
The problem here is obvious, after the crash, I’d get a bunch of unwanted emails. Also, this method requires me to multiply the repeat index by two in order to get a rough idea of the number of files I had to open. I’m sure there’s something I’m missing.
In a related topic, is there any way for Eggplant to compare a different image based on the iteration of the repeat, ie use image4.tiff for comparison the 4th time through the repeat loop?
Thanks for all assistance,