I have a question that could save me a lot of headaches if I can find an answer.
Is there a way to have the Robot to just continue with the next line of code if it fails to find an object it was told to interact with?
For some fields, using:
iErrMsg = SQAFindObject("Type=GenericObject;Text=Name") the field check just doesn't work as ideally as it should and it will act as if it finds the object when it is clearly not there, and it crash when it tries to interact with an object that isn't there.
Also, when it comes to dropdown menus (comboBoxes), if the text item it's looking for (pulled from a datapool) happens to NOT be in the list, I don't want it to crash.
Is there a way I can tell it to just continue to the next line if it runs into an error when trying to interact with a non-existant object or it can't find certain text in a combo box?
My experience with the combolistbox suggests that if the item is not in the list... the script will die. I had "on error" code all over the place but the script would not survive.
There seems to be a limitation in error recovery associated with several of the object interaction functions. I wound up writing wrappers for most of those functions. In the combolistbox wrapper I pulled back the list and searched it for my string, prior to trying to select the value.
If there is a better way, I would love to hear about it.
We also use the method of checking the contents of the listbox first before trying to the select the item.
The only other alternative I know of is to change the GUI Playback Options/Error Recovery to have the On script command failure set to Continue execution instead of Abort playback. This isn't always ideal though as depending on where the failure occurs trying to continue the script may just end up with things in a big mess.