BruceHy wrote:Hi eValid Q/A.
What happens in eValid when the "IndexFindElement" command doesn't find anything?
Good question...thanks very much for asking BruceHy.
It turns out that the way this command is intended to to be used, there is a responsibility on the part of the tester to make sure that either that doesn't happen, or that the script doesn't care if it does.
First, take a look a the command documentation: http://www.e-valid.com/Products/Documen ... ement.html
The command requires a lot of knowledge to help it find what it is supposed to find, and the ONLY thing that is affected when the command is run is the current value of "SourceIndex" -- which as you know is an internally defined position pointer.
You don't need to know the current value of "sourceIndex" -- it will often change as the page structure changes -- but there is one important convention that goes along with how IndexFindElement works:
If nothing is found, then the current value of sourceIndex is NOT CHANGED.
(This is a kind of "do no harm" type of thinking in the design of eValid's script language.)
Usually, if you want to confirm that a search succeeds, you simply validate the value at that particular element.
If that validation fails (the search failed), that command will through an error flag, and you can trap that error flag with an OnErrorGoto... command.
This may seem complicated, but in the context of reliable web application testing, when you expect the test to succeed, the LEAST clutter is the best.
-- eValid Supporty