I am trying to automate the completion of multiple forms by using a Property List and Nested Handlers. The idea is to have a handler that will select relevant forms (one at a time) from the main page. The main page lists the forms, and on clicking the selected form’s button, will follow the prompt to complete the form, and returning to the main page, will proceed to the next form and so on.
My script, below, is only executing the completion of the first form, instead of continuing to select the next form. Any ideas what I am missing? Thank you!
I have three scripts related to this.
First I have the property list like so:
//Forms/Form_PropertyList
to Form_Items_Handler
set Form_Choice to {
Form1:{Icon:"Image/Icons/Form1",Button:"Image/Button/Form1",RunMe:False},
Form2:{Icon:"Image/Icons/Form2",Button:"Image/Button/Form2",RunMe:False},
Form3:{Icon:"Image/Icons/Form3",Button:"Image/Button/Form3",RunMe:False},
Form4:{Icon:"Image/Icons/Form4",Button:"Image/Button/Form4",RunMe:False},
Form5:{Icon:"Image/Icons/Form5",Button:"Image/Button/Form5",RunMe:False}
}
put Form_Choice
return Form_Choice
end Form_Items_Handler
Then I have the outer handler, that will look for the selected form, and inside this handler, will call the inner handler, which is the form’s button.
//Forms/Form_Add_Handler
On Select_Form_Item Form_Choice, Form_Order
put Form_Choice
put Form_Order
Log "Begining Form Selection"
//Enters all your data for you
repeat with each item FormVar of Form_Choice's (Form_Order)
repeat until imagefound(FormVar's Icon)
typetext pagedown
if the repeatindex > 10
throw "Unable to find:"&&it
end if
end repeat
click image:(Form_Choice's ("Form"&the repeatindex)'s Button),searchrectangle:[imagelocation(Form_Choice's ("Form"&the repeatindex)'s Icon)+[-100,-30],imagelocation(Form_Choice's ("Form"&the repeatindex)'s Icon)+[750,30]]
if FormVar's Button = "Image/Button/Form1"
Run "Forms/Form_Add_Handler".Form_one
Exit all
end if
if FormVar's Button = "Image/Button/Form2"
Run "Forms/Form_Add_Handler".Form_two
exit all
end if
if FormVar's Button = "Image/Button/Form3"
Run "Forms/Form_Add_Handler".Form_three
exit all
end if
if FormVar's Button = "Image/Button/Form4"
Run "Forms/Form_Add_Handler".Form_four
exit all
end if
wait 1
end repeat
end Select_Form_Item
For each form, there are specific scripts to complete the data entry.
I have the main script that will call set the property list to the handler and run the handler. For example, if I want to complete Form 1 and Form 2, this is how I call it.
set Form_Choice to "Forms/Form_PropertyList".Form_Items_Handler
set Form_Order to ["Form1", "Form2"]
Run "Forms/Form_Add_Handler".Select_Form_Item Form_Choice, Form_Order