Greetings.
I am attempting to use the <ScriptStep> with JavaScript to create some
conditional branches (i.e. flow controls) for WebTest testing scripts. I am
having problems locating the best way to accomplish this.
MY QUESTIONS
How do you implement conditional branching using a scripting solution in
WebTest
<IFStep> isn't flexible enough for my needs.Where do I find detailed
information about the <ScriptStep> objects?This link describes the step but not
the APIs for the objects it imports.
More details on my questions below.
Here is what I mean by flow control or conditional branching:
FLOW CONTROL (THE BASICS)
execute step#1
execute step#2
if ( ${user} == "name1" ) then
execute step#3
else ( if ${user} == "name2" ) then
execute step#4
end if
PREFERRED SOLUTIONS
Note: it appears there used to be an <IF> statement but it appears to be
missing from the current distribution (at least as of R_1632). That'd probably
do what I need if it were working.
I'd like to use on of these two forms for flow control (both is possible):
FORM 1
Use <ENTITY..> to include include xml fragments from other files
Those xml fragments would use an if/then/else logic to execute other steps
(verifyText, verifyTitle, etc.)
FORM 2
use <ScriptStep>and execute specific instructions within the <ScriptStep>,based
some conditions (ie. if ( username =="..", etc)
I have not found a way to create a VerifyText step object in JavaScript inside
a <ScriptStep>. Also, I haven't been able to determine how I can call a
verifyText(..) method (for example) inside the script.
Can anyone give me some hints for how to use JavaScript inside a <ScriptStep>
to perform conditional testing to alter the flow of a testing script?
RANGE OF ACTIONS
While I know JavaScript, I do not know what the all the available objects and
behaviors are. The documentation shows access to objects step, document and
response and at least one website showed the project and ant objects were
available inside a <ScriptStep> too.
However, while the document object is fairly well document as a JavaScript
object, I do not find a list of methods for step, response, project or ant
objects. Are there any global methods imported into the scripting context too?
Where can I find this information?
Mike
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs