Page 1 of 1

What happens if eValid can't find an element on a page

PostPosted: Mon Nov 17, 2014 8:42 pm
by SNavarro
Evening.

If I run a search using eValid's IndexFindElement command what happens if the element isn't found?

Thanks

Re: What happens if eValid can't find an element on a page

PostPosted: Tue Nov 18, 2014 1:43 pm
by eValid
SNavarro wrote:Evening.

If I run a search using eValid's IndexFindElement command what happens if the element isn't found?

Thanks


Good question, thanks for asking SNavarro.

The sourceIndex value, whatever it is, is NOT changed.

The EventLog will show a FAIL command.

But it may be more complicated: Maybe the browser has not fully parsed the HTML so that the DOM tree is incomplete.

Hence, we generally do something like this: Delay 10 in front of the search command. That's 10 millisecond delay (0.01 seconds) usually is enough to allow the browser to fully create a complete DOM.

This is usually enough for theIndexFindElement command:

http://www.e-valid.com/Products/Documen ... ement.html

Then if the search fails it really IS because the searched for item isn't there.

However, if you are searching for a Regular Expression match, using the IndexFindElementEx the situation may be different:

http://www.e-valid.com/Products/Documen ... nt.ex.html

The search now is going to take a long time, but the "settling time for the page is the same."

That is, you can still use: Delay 10 to provide the needed delay.

Some testers prefer a longer "safety factor," and use: Delay 100 to slow things down by 0.1 seconds.

-- eValid Support