I’m writing a script at the moment to test several buttons in a dialog box, to ensure that they call the correct dialog box. Right now I have a repeat loop with an incrementing variable, ie if testNum=1, then click button x, if testNum=2 then click button Y, etc.
What I have thus far looks like this:
repeat while testNum is less than or equal to 14
if testNum = 1 then
set whatControl to "button1"
clickany("XP_Button_button1")
if anyimagefound("XP/XP_button1Verified") then
set isTestSucessful to "YES"
else
set isTestSucessful to "NO"
end if
end if
//if testNum=2 then...
run WriteResults(whatControl,isTestSucessful)
add 1 to testNum
if I continue with this method I’ll have an “if testNum=X” then click (imageY) loop for each button. I’m fine with that, but I’m interested to know if there’s an easier or more efficient way of doing it.
Thanks a lot, all
Allen