Page 1 of 1

If the index search fails to find a result

PostPosted: Wed Apr 19, 2017 11:55 am
by MRussell
Afternoon.

What happens in eValid if an index search command doesn't find a result.

What can I do to resolve this error?

Thanks

Re: If the index search fails to find a result

PostPosted: Thu Apr 20, 2017 12:38 pm
by eValid
MRussell wrote:Afternoon.

What happens in eValid if an index search command doesn't find a result.

What can I do to resolve this error?

Thanks


A good question MRussell.

There are two main commands for searching the DOM:

IndexFindElement
IndexFindElementEx

will throw an ERROR flag if the command fails to find the element that you are looking for.

You can set an OnError command to catch this kind of failure.

However, you should prepare and prevent errors of this kind by first assuring synchronization when testing AJAX, using commands like the following:

http://www.evalid.us/Products/Documenta ... n.dom.html

This will have the advantage that the page you are search will have arrived and be fully stabilized BEFORE you search the location of some particular element you want.

Also, not that in case the search doesn't find a result, then the current value if sourceIndex -- a variable that is know to the script playback context only --- is NOT CHANGED.

This allows you to do a sequence of searches in a row if you want.

-- eValid Support