I’m a newbie for shurbie! I don’t really understand the subtleties of getting my CleanUp script to work. I thought I got it but it left me along with my coffee buzzzzzzz…
Ok. So. I’m testing a Windows application ( www.tawala.com login and download the Designer.) and when it comes to Exiting the application it has a pretty standard File Menu. FILE then EXIT will work just fine and if you’ve done some work you may get a save Dialogue asking to you if you want to save your work. So… I’m running my scripts from a master which works great. But when one of my tests fail I want CleanUp to run, close the application and run the next test.
All this works swimmingly except for the actual CleanUp script. It runs it just doesn’t do things in the way I would expect it to…
That is.
It should first try to click on “FileMenu” – an image that opens the Windows File Menu
Then Click on “Exit” – an image that Clicks on Exit to close the application.
AND… if the Save Dialogue comes up… I want it to simply click “No” – an image that will click NO in the save dialogue.
Seems easy huh? I still don’t think I understand the IF vs. Else IF… that must be it… It clicks on FileMenu but it never clicks on Exit. Odd. It’s been explained to me by the finest minds but I think I need to hear it another way… possibly involving 2nd grade grammar… or I need some punch and pie to make it stick.
Here is the offending master script in total and the single script I’m asking it to run and fail just so I can get CleanUp to work. Oh, and anyone can download and test are app… it’s in Alpha… check out www.tawala.com and you can see the DESIGNER application… if it helps… help!
// Master Script
put ( “442_443_444” ) into scriptList
repeat for each item in scriptList
try
put it
run it
catch
// this will place the exception name into a variable
put exceptionName() & exceptionreason() into var
// this will write the value of ‘var’ to a file of your choosing
put var & return after file “~/Desktop/logfile.txt”
// increment of yes will ensure that you don't replace existing images
captureScreen(name:var, increment:Yes)
cleanUp
end try
end repeat
// clean up using if else if…
to CleanUp
if imageFound(“FileMenu”) then
click foundImagelocation()
else if imageFound("Exit") then
click foundImageLocation()
else if imageFound("No") then
click foundImagelocation()
end if
end CleanUp
// End Master Script
// Test Script called 442_443_444
set the remoteWorkInterval to 1.1
set the mouseMoveSpeed to 8
set the nextKeyDelay to 0.15
// This just clicks on a shortcut on the desktop to launch the application
DoubleClick “StartDevXP”
TypeText “\af\A”
TypeText “\r”
TypeText “w”
TypeText “f”
TypeText “\ai\A”
TypeText “t”
TypeText “Please Provide your email address. _______________”
TypeText “\ca\C”
// Click “FormatClick”
// Click “ItalicClick”
TypeText “\cb\C”
TypeText “\cu\C”
TypeText “\ci\C”
WaitFor 3.0, “BoldItalicsUnderlineConfirm”
// close
TypeText “\af\A”
TypeText “\r”
TypeText “x”
// Don’t Save
Click “DontSave”
// this returns the desktop icon to the deselected state so the next test can find it
Click “ClickBlueDesktop”