Hi,

all the objects are from WebTest, Ant or HtmlUnit and documented in their respectives Javadoc.

An ifStep step is available in WebTest. If you want to script your execution flow, you should perhaps do it from Groovy. Programming in xml is not really the best thing.

Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com


Mike B wrote:
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

   1. How do you implement conditional branching using a scripting
      solution in WebTest
         1. <IFStep> isn't flexible enough for my needs.
   2. Where do I find detailed information about the <ScriptStep> objects?
         1. This link
            <http://webtest.canoo.com/webtest/manual/scriptStep.html>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 homepage. <http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>


_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to