[Webtest] Customizing WebTest

Akif Sawafteh Akif Sawafteh <asawafteh@atypon.com>
Mon, 5 Dec 2011 15:39:11 +0200


--90e6ba21244f9cc28d04b35871eb
Content-Type: text/plain; charset=ISO-8859-1

Hello everyone,

I'm trying to customize WebTest by implementing the interface
IWebtestCustomizer. The documentation says that:
"This interface is intended for users that need to customize WebTest. When
a WebtestTask is executed, it will look at Project.getReference(String)
with the key KEY for a IWebtestCustomizer. If a IWebtestCustomizer is
found, its methods will be called (see methods descriptions). If now
reference is found, a DefaultWebtestCustomizer will be instantiated and
used.".

I don't know exactly how should I define the reference
"wt.webtestCustomizer". I tried executing the following script:

<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../dtd/Project.dtd">
<project default="test" basedir=".">

    <path id="wt.webtestCustomizer">
        <pathelement path="/classes/MyWebtestCustomizer" />
    </path>

    <target name="test">
        <webtest name="Invoke google.com">
            <invoke url="http://www.google.com"/>
            <verifyTitle text="Google"/>
        </webtest>
    </target>

</project>

but I got this error:

"Could not create type webtest due to Provided customizer is not a
IWebtestCustomizer: /classes/MyWebtestCustomizer"

My question is, how should I add the reference to the Canoo Webtest script?


Thanks in advance!

--90e6ba21244f9cc28d04b35871eb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello everyone,<br><br>I&#39;m trying to customize WebTest=
 by implementing the interface IWebtestCustomizer. The documentation says t=
hat:<br><div style=3D"margin-left: 40px;">&quot;This interface is intended =
for users that need to customize WebTest. When a WebtestTask is executed, i=
t will look at Project.getReference(String) with the key KEY for a IWebtest=
Customizer. If a IWebtestCustomizer is found, its methods will be called (s=
ee methods descriptions). If now reference is found, a DefaultWebtestCustom=
izer will be instantiated and used.&quot;.<br>
<br></div><div>I don&#39;t know exactly how should I define the reference &=
quot;wt.webtestCustomizer&quot;. I tried executing the following script:<br=
><br><div style=3D"margin-left: 40px;">&lt;?xml version=3D&quot;1.0&quot;?&=
gt;<br>
&lt;!DOCTYPE project SYSTEM &quot;../dtd/Project.dtd&quot;&gt;<br>&lt;proje=
ct default=3D&quot;test&quot; basedir=3D&quot;.&quot;&gt;<br>=A0=A0=A0 <br>=
=A0=A0=A0 &lt;path id=3D&quot;wt.webtestCustomizer&quot;&gt;<br>=A0=A0=A0 =
=A0=A0=A0 &lt;pathelement path=3D&quot;/classes/MyWebtestCustomizer&quot; /=
&gt;<br>
=A0=A0=A0 &lt;/path&gt;=A0=A0=A0 <br><br>=A0=A0=A0 &lt;target name=3D&quot;=
test&quot;&gt;<br>=A0=A0=A0 =A0=A0=A0 &lt;webtest name=3D&quot;Invoke <a hr=
ef=3D"http://google.com">google.com</a>&quot;&gt;<br>=A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 &lt;invoke url=3D&quot;<a href=3D"http://www.google.com">http://w=
ww.google.com</a>&quot;/&gt;<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 &lt;verifyTitle text=3D&quot;Google&quot;/&gt=
;<br>=A0=A0=A0 =A0=A0=A0 &lt;/webtest&gt;<br>=A0=A0=A0 &lt;/target&gt;<br><=
br>&lt;/project&gt;<br></div><br>but I got this error:<br><br><div style=3D=
"margin-left: 40px;">&quot;Could not create type webtest due to Provided cu=
stomizer is not a IWebtestCustomizer: /classes/MyWebtestCustomizer&quot;<br=
>
</div><br><div>My question is, how should I add the reference to the Canoo =
Webtest script?<br><div><br><br>Thanks in advance!<br></div></div></div></d=
iv>

--90e6ba21244f9cc28d04b35871eb--