on 05/12/06 12:54 George Bills said the following:
...ETC... I load "webtest.xml" once to define all the webtest stuff in
my Ant test harness ...ETC... but that means that you can't run the
tests individually (because they'll be missing the webtest
definitions). Hope that helps.
Thanks for the answer. Yes, that is why I have the taskdef in each test
as I do want to be able to both run the tests as a set and also run each
test individually on demand while I'm working on a single web page. I'm
resisting just putting the taskdef in a master ant file and doing all
calls via that (but that seems to be where I'm going) or otherwise
manually editing each file if I want to run a single case ... that
didn't seem to be the proper use ... but looks like I'm going to do
that (one build.xml to rule them all, one explicit target per sub-file
to allow running tests for just that page alone ... ggrrrr).
That means the following formations that I'd enjoyed using in my
build.xml are unusable, and I'll have to have a named ant target for
each test file that I generate, I can't just include them with wildcards
and add new files at will without also editing the build.xml.
<target name="everything" depends="init"
description="--> run Canoo WebTest tests">
<subant target="all">
<fileset dir="." includes="test*.xml"/>
</subant>
</target>
<target name="testAux" depends="init">
<subant target="all">
<fileset dir="." includes="testAux*.xml"/>
</subant>
</target>
<target name="testSite" depends="init">
<subant target="all">
<fileset dir="." includes="testSite*.xml"/>
</subant>
</target>
<target name="testSetup" depends="init">
<subant target="all">
<fileset dir="." includes="testSetup*.xml"/>
</subant>
</target>
Furthermore the code that I suggested is rubbish, because it is itself a
test step, and throws an error:
.../test/webtests/includes/definition.xml:2: Could not create task or
type of type: ifStep
<ifStep description="Run Taskdef Once"
unless="${taskdefLoaded}=='true'">
<taskdef file="${canoowebtest.home}/webtestTaskdefs.properties"/>
<property name="taskdefLoaded" value="true" />
</ifStep>
on 05/12/06 12:54 George Bills said the following:
I'm not sure if this is what you want, but you can pass properties
from Ant script to Ant script - most ways of calling an Ant script
pass properties from the parent to the child by default, and you can
use "inheritall='true'" otherwise. I load "webtest.xml" once to define
all the webtest stuff in my Ant test harness, and then that test
harness calls the tests. The tests themselves don't need to include
the webtest stuff at all - but that means that you can't run the tests
individually (because they'll be missing the webtest definitions).
Hope that helps.
Rob Manthey wrote:
(I'll probably be corrected shortly, but I think this is what Marc is
getting at ...)
This line (may have been slightly modified by me for my local
conditions) must appear somewhere for webtest to work:
<taskdef file="${canoowebtest.home}/webtestTaskdefs.properties"/>
Anyway, each time it is included it instantiates a bunch of resources
from the sounds of it and so it should only be run once per set of
tests. I guess this means wrapping it in some sort of conditional,
but I have at the top of each file, so that's why (?) I accumulate
memory usage when I hit "ant all" as the jvm is created once per ant
session, but the webtest taskdef is called for every file.
What is the optimal way to have the taskdef declared for each file,
but so that it only gets called once if that file is referenced by
wrapper files? Such as:
<ifStep description="Run Taskdef Once"
unless="${taskdefLoaded}=='true'">
<taskdef file="${canoowebtest.home}/webtestTaskdefs.properties"/>
<property name="taskdefLoaded" value="true" />
</ifStep>
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest