If IndexFindElement doesn't match anything, how do you know?

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

If IndexFindElement doesn't match anything, how do you know?

Postby ECamron » Fri May 04, 2012 3:24 pm

If IndexFindElement doesn't match anything, how do you know that? Is it an ERROR?
ECamron
 
Posts: 1
Joined: Fri May 04, 2012 3:21 pm

Re: If IndexFindElement doesn't match anything, how do you k

Postby eValid » Wed May 09, 2012 11:20 am

ECamron wrote:If IndexFindElement doesn't match anything, how do you know that? Is it an ERROR?
The source you should consult is the EventLog. It will tell you if the IndexFindElement found a match, or didn't find a match.

No it is not an ERROR.

The thinking behind this is the following. If you ask eValid to find the value of the index of an element on the page that matches, it will find it for you -- and store it in the SourceIndex spot. But if it isn't there, then it will tell you it didn't find it, but there's really nothing wrong with the page, it is just that your script is asking the wrong question. eValid tries to be polite -- and in this case it politely "forgives the question" and doesn't penalize you for it.

However, there are cases when NOT finding something is important. For example you can use MatchNotString to verify that a string is NOT present in the page. And, you can use the SyncNotOnElementProperty command to verify that a particular element property -- any one that you wish -- is NOT present on the page. eValid finds that it is NOT there on the first pass, so it never has to try a second time.

So all of the options you could want are there when you need them.

eValid Technology
eValid
 
Posts: 2395
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