What some of us here at AMD have done is leverage the ant framework and
used the macrodef task.

 

-----------  snippet of macro library --------

 

<project name="anon-lib" xmlns:anon="test.anon">

 

  <!-- .... Other macros ... --!>

 

  <macrodef name="clickTab-verifyText-return" uri="test.anon">

    <attribute name="tabName"/>

    <attribute name="innerText"/>

    <sequential>

       <clickLink label="@{tabName}"/>

       <followframe htmlId="iBody"/>

       <verifyText text="@{innerText}" />

       <selectWindow index="0"/>

    </sequential>

  </macrodef>

 

  <!-- ... more macros ... --!>

 

</project>

---------------- end ------------------

 

This code snippet clicks a link which causes an iFrame to change. Then
enters the iFrame and verifies that innerText is present.  Then returns
to the main window.

 

Below is how you call it.

 

-----------  snippet of macro call --------

 

<project name="InstallCheck" default="test" xmlns:base="test.base"
xmlns:anon="test.anon">

<import file="${testlib.dir}/anon-lib.xml"/>

<target name="test">

    <stdwebtest name="blah">

       <test-steps>

            <!-some steps --!>

            <anon:clickTab-verifyText-return tabName="tabLinkText"
innerText="Hello World" /> 

       </test-steps>

    </stdwebtest>

</target>

 

Hope I helped

 

Big Mike

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Deepa Nigam
Sent: Thursday, April 03, 2008 5:32 PM
To: [EMAIL PROTECTED]
Subject: RE: [Webtest] help!

 

Ok. Thanks. Is it possible to invoke another target from the middle of
the target: Like calling functions.
 
Thanks,
Deepa



________________________________

Subject: RE: [Webtest] help!
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Date: Thu, 3 Apr 2008 16:43:07 -0500

I think the Kevin Casey answered your question already... Aren't random
numbers in the set of random strings?

 

I don't like e-mailing manual links but please see "storeRandom string
Example" on http://webtest.canoo.com/webtest/manual/storeRandom.html

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Deepa Nigam
Sent: Thursday, April 03, 2008 3:57 PM
To: [EMAIL PROTECTED]
Subject: [Webtest] help!

 

Hi,
 
Can we use storeRandom to create strings randomly ? Can someone post an
example of how to do that ?
 
Thanks,
Deepa

________________________________

Get in touch in an instant. Get Windows Live Messenger now.
<http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Re
fresh_getintouch_042008> 

        --Forwarded Message Attachment--
        Subject: Re: [Webtest] How to generate random numbers
        Date: Wed, 2 Apr 2008 15:33:46 -0500
        From: [EMAIL PROTECTED]
        To: [EMAIL PROTECTED]
        CC: [EMAIL PROTECTED]
        
        Hello Deepa- 
        I've yet to use storeRandom myself, but from reading the docs,
seems 
        like you could do something like: 
        <storeRandom property="myRandomNumber" from="0" to="10" /> 
        <setInputField htmlId="id_random_field"
value="#{myRandomNumber}" /> 
        the first step will store an integer in the range 0-10
(inclusive) in a 
        property called "myRandomNumber". the second step will enter the
value 
        of myRandomNumber into a text input field on your page with the
ID 
        "id_random_field". The first step is the important one, in your
case - 
        once you have the random number stored in a property, you can do

        anything you want with it with any other Webtest steps. 
        Good luck! 
        On Wed, 2008-04-02 at 13:23 -0700, Deepa Nigam wrote: 
        > Hi, 
        >  
        > I am new to Canoo Webtest. My application requires random
number 
        > generation. Is there any method in Canoo that I can use to
generate 
        > random numbers. I saw storeRandom but not sure how to use it. 
        >  
        > Can someone help ! 
        > 
        > 
        >
______________________________________________________________________ 
        > Use video conversation to talk face-to-face with Windows Live 
        > Messenger. Get started! 
        _______________________________________________ 
        WebTest mailing list 
        [email protected] 
        http://lists.canoo.com/mailman/listinfo/webtest 

 

________________________________

Get in touch in an instant. Get Windows Live Messenger now.
<http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Re
fresh_getintouch_042008> 

Reply via email to