[Webtest] Custom Step VerifyContentType added to community web site

Marc Guillemot webtest@lists.canoo.com
Tue, 10 Aug 2004 14:03:37 +0200


Hi Paul,

it's not noise, these are good contributions.

I had written such a verifycontenttype task for my purposes too but I didn't want to commit it, because I thought that 
it was not general enough and would contribute to a uncontrolled growth of tasks with not so many differences.

My first suggestion would to have a verifyresponseheader, which could be used to check content type as well as other 
headers sent by the server.

My alternative solution would be to provide such properties of the last response as dynamic properties. With a new 
general purpose "verify" task, we could write tests like <verify expected="image/gif" value="#{lastResp.contentType}"/>. 
or <verify expected="404" value="#{lastResp.responseCode}"/>

Marc.


Paul King wrote:
> 
> 
> I have added the following custom step to the community web site:
> 
> http://webtest-community.canoo.com/wiki/space/VerifyContentType
> 
>  From the description:
> 
> This custom step provides the ability to check content type of a page.
> 
> An example:
> 
> <target name="testImage" depends="init">
> <testSpec name="testImage">
>   &config;
>   <steps>
>     <invoke
>       stepid="Load Image"
>       url="resources/images/linevertical.gif"/>
>     <verifyContentType
>       stepid="Should be a gif"
>       text="image/gif"/>
>   </steps>
> </testSpec>
> </target>
> 
> Cheers, Paul.
> P.S. Sorry for all the noise, but I have to document all custom steps 
> for a project that my company is working on.
> 
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>