I am prototyping a test tool for an application that has a large number of fields on several screens. The primary script uses Include>filename1, Include>filename2, etc. for the screens that will be used in that script.
I am concerned that as I get all of the fields on a screen coded (a GetValue and a SetValue for each field), my script will be getting really large.
Is this going to be an an issue for 100+ fields per screen with 3 or 4 screens per script?
Is there a better way?
Thx
Is there a better way to handle large "Includes"?
Moderators: JRL, Dorian (MJT support)
Macros vs Includes
I don't think there is any problem with scripts containing lots of includes r as size is concerned. You will need to be careful to initialize all your variables in your subroutines because they are global in scope and probably frequently reused.
We are using the macro command to make our scripts more managable. Each called macro script will be small and variables used in the called macro are local to it so reuse should be more reliable. Each called macro would handle the fields for a specific screen as in your case.
Each macro contains include statements for the common subroutines. The subroutines in the includes are very generic in nature, not specific to any particular screen. The included subroutines might be things like DoOCR, ReportResult, SendEmail, ParseMacroResult, and EventHandler.
We are using the macro command to make our scripts more managable. Each called macro script will be small and variables used in the called macro are local to it so reuse should be more reliable. Each called macro would handle the fields for a specific screen as in your case.
Each macro contains include statements for the common subroutines. The subroutines in the includes are very generic in nature, not specific to any particular screen. The included subroutines might be things like DoOCR, ReportResult, SendEmail, ParseMacroResult, and EventHandler.