Hi,
webtest,xml contains hooks to simply add custom locations to the
classpath used to load the tasks. You can do for instance something like
following in your project:
<target name="wt.defineTasks.init" description="customized classpath">
<antcall target="wt.webtest.wt.defineTasks.init" inheritRefs="true"/>
<path id="wt.defineTasks.classpath.customPrepend">
<pathelement location="path/to/your.jar"/>
</path>
</target>
<import file="${webtest.home}/webtest.xml" description="Import all
functionalities for a full build"/>
Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com
Chaohua Wang wrote:
> Hi Folks,
>
> I am use ant sql and webtest right now. I put the jdbc driver
> file(jtds.jar) in ="${webtest.home}/lib/.
> So I can refer this classpath
> <classpath>
> <pathelement
> location="${webtest.home}/lib/jtds.jar"/>
> </classpath>.
>
> But I looked at webtes.xml file, there is a pathid
> <path id="wt.defineTasks.classpath.webtest">
> <pathelement location="${~wt.WebTest.dir}/lib"/>
> <!-- to find webtest's log4j properties -->
> <fileset dir="${~wt.WebTest.dir}/lib"
> includes="*.jar"/>
> </path>
>
> Can I refer this pathid, or inherited some property from webtest.xml
> file?
> Thank you very much.
>
> cwang
>
>
>
> <property name="webtest.home" value="${basedir}/.." />
> <import file="${webtest.home}/lib/taskdef.xml"/>
>
> <target name="test" description="Tests if webtest can connect to
> a DB
> and submit a query">
> <sql
> driver="net.sourceforge.jtds.jdbc.Driver"
> url="jdbc:jtds:sqlserver://10.3.1.201/BillPay"
> userid="settle"
> password="settle"
> print="yes"
> onerror="continue"
> output="C:\Apache2.2\htdocs\SQL_output.txt"
> >
> <classpath>
> <pathelement
> location="${webtest.home}/lib/jtds.jar"/>
> </classpath>
> <![CDATA[
> INSERT INTO Payments_Staging (RefNumber, VAN, Amount,
> OptCode, VendorID, PriorRefNumber, TransactionTS, IsProcessed) VALUES
> ('3922343434334','213132123123213','1131',2031,232,'7898', { fn NOW()
> },1);
> ]]>
> </sql>
>
>
> <webtest name="Insert SQL query output">
> &config;
> <steps>
> <invoke url="SQL_output.txt"/>
> <verifyText text="1" />
> </steps>
> </webtest>
>
> <webtest name="check that WebTest is Yahoo 'WebTest'
> result">
> <invoke url="http://www.yahoo.com/"
> description="Go to Yahoo(in English)"/>
> <verifyTitle text="Yahoo!" />
> <setInputField name="p" value="WebTest" />
> <clickButton label="Web Search" />
> <verifyTitle text="WebTest - Yahoo! Search
> Results" />
> </webtest>
>
> </target>
> </project>
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest