[Webtest] "Cannot call method "submit" of undefined" Error FIXED

lostinheaven.lee@gmail.com lostinheaven.lee@gmail.com
Thu, 18 Sep 2008 17:22:06 +0800


------=_Part_12740_9416778.1221729726729
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi, All

A few days ago, I poped a strange erroe of "Cannot call method "submit" of
undefined", and Marc offered lots help,still not work out.
I almost gave up, yesterday Ifixed it, I think I should report tht vesolve
to the list, it may helps newbies on WebTest like me.

the key point is DTD file. What I did:

1. Creat a build.xml anywhere you like.the content as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project>
   <target name="makedtd">
       <antstructure output="project.dtd" />
   </target>
</project>

2. Go to the very directory where the build.xml is in. type: ant makedtd
  although a build failed will be reported, a file named project.dtd will be
created as well. copy it to the dtd folder of my test project. make a little
change:

   - on the 3ed line"<!ENTITY % tasks "propertyfile |........" , add webtest
   as one of the parameters
   - on the 6th line"<!ELEMENT project (target | %tasks; | %types;)*>",
   change the * into

3. copy WebTest.dtd and MyWebTest.dtd to the dtd folder of my test projest.
make changes on MyWebTest.dtd as follows:

   - <!ENTITY % webtest  SYSTEM "../config/WebTest.dtd" >  =>  <!ENTITY %
   webtest  SYSTEM "../dtd/WebTest.dtd" >
   - <!ENTITY % project  SYSTEM "../config/Project.dtd">  =>  <!ENTITY %
   project  SYSTEM "../dtd/Project.dtd">
   - add follow lines

<!-- project  Ant entities -->
<!ENTITY % projectAnt  SYSTEM "../dtd/ProjectAnt.dtd">
%projectAnt;

4. change the associated scheme of test script into WebTest.dtd in dtd
folder.

That's all

I don't figure out the reason clearly, But it works.

It would be great if anyone could tell me why it works.

thanks.

------=_Part_12740_9416778.1221729726729
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr"><div>Hi, All<br><br>A few days ago, I poped a strange erroe of &quot;Cannot call method &quot;submit&quot; of undefined&quot;, and Marc offered lots help,still not work out.<br>I almost gave up, yesterday Ifixed it, I think I should report tht vesolve to the list, it may helps newbies on WebTest like me.<br>

<br>the key point is DTD file. What I did:<br><br>1. Creat a build.xml anywhere you like.the content as follows:<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;project&gt;<br> &nbsp; &nbsp;&lt;target name=&quot;makedtd&quot;&gt;<br>

 &nbsp; &nbsp; &nbsp; &nbsp;&lt;antstructure output=&quot;project.dtd&quot; /&gt;<br> &nbsp; &nbsp;&lt;/target&gt;<br>&lt;/project&gt;<br><br>2. Go to the very directory where the build.xml is in. type: ant makedtd <br> &nbsp; although a build failed will be reported, a file named project.dtd will be created as well. copy it to the dtd folder of my test project. make a little change:<br>

<ul><li> on the 3ed line&quot;&lt;!ENTITY % tasks &quot;propertyfile |........&quot; , add webtest as one of the parameters</li><li> on the 6th line&quot;&lt;!ELEMENT project (target | %tasks; | %types;)*&gt;&quot;, change the * into&nbsp;</li>

</ul></div>3. copy WebTest.dtd and MyWebTest.dtd to the dtd folder of my test projest. make changes on MyWebTest.dtd as follows:<br><ul><li>&lt;!ENTITY % webtest&nbsp; SYSTEM &quot;../config/WebTest.dtd&quot; &gt;&nbsp; =&gt;&nbsp; &lt;!ENTITY % webtest&nbsp; SYSTEM &quot;../dtd/WebTest.dtd&quot; &gt;</li>

<li>&lt;!ENTITY % project&nbsp; SYSTEM &quot;../config/Project.dtd&quot;&gt;&nbsp; =&gt;&nbsp; &lt;!ENTITY % project&nbsp; SYSTEM &quot;../dtd/Project.dtd&quot;&gt;</li><li>add follow lines</li></ul>&lt;!-- project&nbsp; Ant entities --&gt;<br>&lt;!ENTITY % projectAnt&nbsp; SYSTEM &quot;../dtd/ProjectAnt.dtd&quot;&gt;<br>

%projectAnt;<br><br>4. change the associated scheme of test script into WebTest.dtd in dtd folder.<br><br>That&#39;s all<br><br>I don&#39;t figure out the reason clearly, But it works. <br><br>It would be great if anyone could tell me why it works. <br>

<br>thanks.<br><br></div>

------=_Part_12740_9416778.1221729726729--