Hi,

if you have existing code using HtmlUnit directly, you surely have some
methods with a WebClient or an HtmlPage as parameter. If you make your
custom classes available in the classpath of your webtest project, you
can call them from a groovy step (or scriptStep, but Groovy is simply
better ;-)):

<groovy>
import my.package.MyClass

MyClass.doSomething(step.context.currentResponse)
MyClass.doSomethingElse(step.context.webClient)
</groovy>

or wrap your method in a Step to allow reuse like
<myCustomStep .../>

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


devarani ratnam wrote:
> Hi,
> I am evaluating different web testing tools for a new project and Canoo
> Webtest seems very interesting. However, my team have used HtmlUnit in
> the past and we have few libraries of common functions written in Java.
> I wonder, is there any way I can integrate and reuse those libraries
> instead of rewrting all of them in xml for webtest.
> 
> Thanks,
> Dev
> ------------------------------------------------------------------------
> Make Windows Vista more reliable and secure with Windows Vista Service
> Pack 1. Learn more.
> <http://www.windowsvista.com/SP1?WT.mc_id=hotmailvistasp1banner>

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

Reply via email to