I have a general question on the best approach to handle HTML form completion from a reusable action when the names and number of form elements change from one iteration of the action to the next. I supppose I could check if the object exists before I call the Set method but I thought there might be a better approach. I'm still learning QuickTest Pro and would appreciate any code/insight from those who may have faced a similar situation.
'Only click OK button if it actually exists
OptionalStep.vbwindow("Mywindow".vbutton("OK".click</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Using the if object.exist(timeout) method may increase the playback speed of your scripts though.
Theres my $0.02 on the subject [img]images/icons/smile.gif[/img]
Actually I do know the maximum number of elements that can potentially exist. The web application under test was developed with Weblogic Workshop which includes a feature known as form beans. There are only five for the entire application.
There are more than five HTML forms but all of them are based on the five form beans and their respective properties which map to the form element names on the various forms. I never know exactly what form elements will exist on a form but I do know the set of form element names in advance. My thought was to create five actions, one for completing each form and making each step that enters a value for a form element an optional step or testing for existence beforehand.