The settings for sourceIndex and elementValue

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

The settings for sourceIndex and elementValue

Postby mozil » Fri Jul 08, 2011 4:44 pm

Does CallScript preserve the settings for sourceIndex and elementValue?
mozil
 
Posts: 1
Joined: Fri Jul 08, 2011 4:41 pm

Re: The settings for sourceIndex and elementValue

Postby eValid » Mon Jul 11, 2011 9:21 am

mozil wrote:Does CallScript preserve the settings for sourceIndex and elementValue?
Actually, these values are NOT passed to a called sub-script -- that is, one that is the target of a CallScript script.evs command.

The reason for this is to preserve each script as an independent entity, so that they can be mixed and matched in any order. If a sub-script relied on the context of it's parent, this wouldn't be possible.

Instead, there is a different mechanism in eValid to allow scripts to be called in any order for a variety of purpoes, but still keep track of the values of sourceIndex and elementValue, which are crucially important for use in the structural testing commands.

The method is called a Reserved Variable, and these parameters are reserved across script calling boundaries -- they really represent the context of the test. The two variables are $_SourceIndex and $_ElementValue and they ALWAYS contain the current sourceIndex and elementValue no matter what.

eValid Support
eValid
 
Posts: 2396
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