Hi Lisa,

the changes in the result format is surely not enough documented. Nevertheless it has been explained many times in the mailing list and is announced in the news on the website.

I recommend to use webtest.xml through the <import file="..."/> Ant task. This utility file contains all actions commonly needed to setup a WebTest project and to format the results at the end. It allows to really simplify the main build file of a WebTest project.

Even if it would be good, I don't know when/if I will find time to write a doc concerning how to migrate to use webtest.xml. Many users have already written that the webtest.xml's content already explains how to use it. You can have a look too at the demo project created by the target wt.createProject if you want to see in a real project how webtest.xml should be used (explained in http://webtest.canoo.com/webtest/manual/install.html).

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


Lisa Crispin wrote:
OK, doing one test at a time isn't that hard, I can just pass in the name of the test, and change the build.xml to use it as part of the file name: <xslt in="${resultsPath}/001_${canooTestToRun}/WebTestReport.xml" out="${resultsPath}/formattedCanooResults.html"
              destdir="${resultsPath}"

(and what is with that number 001 in front of the test name?)

But normally we run a whole suite of tests. Is there some way to grab the name of each test and format it, or what? The target to run the tests looks like this: <target name="run-canoo" depends="canoo-taskdef" description="Runs canoo tests in nightly build only (requires running application).">
        <delete dir="${resultsPath}"/>
        <mkdir dir="${resultsPath}"/>
        <ant antfile="${test.webtest.scripts.dir}/PlanEstTourTest.xml"/>
        <ant antfile="${test.webtest.scripts.dir}/PlanAdminTourTest.xml"/>
 etc etc.

Thanks,
Lisa



On Dec 13, 2007 1:19 PM, Lisa Crispin <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I don't know if I'm explaining this more so I'll try to clarify.

    To run one test, we have this in the build.xml:
        <target name="run-one-canoo" depends="canoo-taskdef"
    description="Runs specified canoo test (requires running
    application).">
            <delete dir="${resultsPath}"/>
            <mkdir dir="${resultsPath}"/>
            <ant antfile="${test.webtest.scripts.dir}/${canooTestToRun}"/>
        </target>
    To format the results, we have this:
      <target name="format-canoo-results" description="Formats the Canoo
    Results file into an Html Page">
            <xslt in="${resultsPath}/result.xml"
    out="${resultsPath}/formattedCanooResults.html"
                  destdir="${resultsPath}"
                  style="${webtesthome}/resources/WebTestReport.xsl">
                <param name="indexTests"
    expression="formattedCanooResults.html "/>
                <param name="outputDir" expression="${resultsPath}"/>
            </xslt>
        </target>

    Then I can run a test with this:
    ant -Dwebtesthome=C:/canoo
    -DwebTestSrc=/eclipse_projects/fast401k/src/web_test/
    -Dhostname=chester -Dport=80
    -DresultsPath=/canoo/logs/chester_results -DcanooTestToRun=$1.xml
    run-one-canoo
    ant -Dwebtesthome=c:/canoo
    -DresultsPath=c:/canoo/logs/chester_results format-canoo-results

    So my result files would all be under c:/canoo/logs/chester_results.

    Now my result files are in
    c:/canoo/logs/chester_results/001_TestScriptName, where
    TestScriptName is the name of that test I ran. Naturally, the task
    to format the results fails because it can't find the result file.

    I confess I haven't changed anything about how we run these tests
    in, oh, 3 or 4 years. I've been coming thru the online manual and
    changing things according to what it says, I even did that little
    command line thing to create a sample project and tried to copy what
    it created. That gets rid of the little messages nagging me that I'm
    doing something that was deprecated, but it doesn't change how the
    results go out.

    Thanks,
    Lisa



    On Dec 13, 2007 12:45 PM, Lisa Crispin <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]> > wrote:

        I'm sure this is a stupid question, but I don't have much time
        to upgrade to the newest version and I'm not knowledgeable
        enough to figure this out myself. I've searched the archives
        with no luck. I don't know where to find information on things
        that are changed in the latest releases. Formerly I had build
        1551 installed.

        I just installed the latest build, 1646. When I run a script, it
        runs fine, but where it used to put result files directly into
        the 'logs' directory, now it creates an extra folder with the
        name of the test and a number prefix, and then within that
        folder, the result files have a prefix appended to them with a
        number. I have no idea how to go about formatting the results
        using WebTestReport.xsl in this case, because right now I'm just
        giving it the results path consisting of my hard coded log
        directory name.

        How do I either: 1) make it work the way it used to or 2) format
        results that have variable names like this?

        I haven't tried to run a suite, I assume that's going to create
        a directory for each test in the suite?

        And - where DO I find information about the latest changes in
        WebTest?  I found the change log for the latest build, but I
        don't believe this change to where the result files are written
        and how they're named is in this build.

        Sorry for all the dumb questions. I only get time to upgrade
        versions every few months (and this time we had to upgrade log4j
        also, so it would work).

        Thanks,
        Lisa




-- Lisa Crispin
    Co-author with Janet Gregory, Agile Testing
    http://www.agiletester.ca <http://www.agiletester.ca>
http://lisa.crispin.home.att.net



--
Lisa Crispin
Co-author with Janet Gregory, Agile Testing
http://www.agiletester.ca
http://lisa.crispin.home.att.net


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

Reply via email to