Not finding the Element using the IndexFindElement

Applying eValid to AJAX applications that require advanced DOM-based methods.

Not finding the Element using the IndexFindElement

Postby BruceHy » Tue Feb 16, 2016 11:38 am

Hi eValid Q/A.

What happens in eValid when the "IndexFindElement" command doesn't find anything?

Thanks
BruceHy
 
Posts: 1
Joined: Tue Feb 16, 2016 11:31 am

Re: Not finding the Element using the IndexFindElement

Postby eValid » Wed Feb 17, 2016 2:40 pm

BruceHy wrote:Hi eValid Q/A.

What happens in eValid when the "IndexFindElement" command doesn't find anything?

Thanks


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
eValid
 
Posts: 2392
Joined: Tue Jan 01, 2008 12:48 pm
Location: USA


Return to AJAX Applications & DOM Processing

Design Downloaded from free phpBB templates | free website templates | Free Web Buttons