[Webtest] cannot get <scriptStep> to work - ClassNotFoundException: org.apache.bsf.engines.javascript.JavaScriptEngine

Paul King webtest@lists.canoo.com
Fri, 21 Apr 2006 22:05:34 +1000


Chris, try adding a bootstrap target to your build as follows:

<project name="scriptTest" basedir="." default="bootstrap">
[... as before ...]
<target name="bootstrap">
    <java classname="org.apache.tools.ant.Main" fork="true"
            classpathref="${webtest.path.id}">
        <arg line="-f ${ant.file} scriptStep"/>
    </java>
</target>
[... as before ...]

If that works, we should investigate fixing our taskdef/classpath xml
files or step code to make this work without the bootstrap.

Cheers, Paul.

Chris Gerrard wrote:
> I'm puzzled by this.
> 
> Trying to use a stripped down version of one of the scriptStep samples 
> from the doc and am getting a message telling me:
> [scriptStep] java.lang.ClassNotFoundException: 
> org.apache.bsf.engines.javascript.JavaScriptEngine
> [...] 
> ======================================
> the build file: scriptTest.xml <begin>
> ======================================
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE project SYSTEM "WebTest.dtd"
> [<!ENTITY sharedConfiguration SYSTEM "WEPSInclude.xml">]
>  >
> 
> <project name="scriptTest Test" basedir="." default="scriptTest">
> 
> <property name="webtest.home" location="C:/Java/webtest" />
> 
> <import file="${webtest.home}/lib/taskdef.xml"/>
> 
> <target name="scriptTest">
>    <webtest name="scriptTest">
>    <config host="yahoo.com"
>            protocol="http"
>            basepath=""
>            >
>    </config>
>        <steps>
>            <scriptStep language="javascript">calc_qty = 
> 0;</scriptStep>              </steps>
>    </webtest>
> </target>
> 
> </project>
>