[Webtest] submitting a form that relies on javascript

David Gibbs (IT) webtest@lists.canoo.com
Thu, 17 Jul 2003 17:16:59 +0100


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C34C7E.D97A0A30
Content-Type: text/plain;
	charset="iso-8859-1"

Chaps,
 
I've got stuck trying to submit a form that relies on java script for
submission.
The link that submits the form is of the form.
 
 <a href="javascript:afSubmit()" class="header"><b>Submit</b>&nbsp;<img
src="img/ig_arrow.gif" width="4" height="7" border="0" alt=""></a>
 
I can't use "clickbutton" (because there isn't one) and I presume
"clicklink" isn't succeeding from the following stack trace.
 
Are there any alternative ways to submit the form ? 
here's the way I tried "clicklink"
 
<clicklink stepid="Try to submit form"
                 label="Submit"
                 href="afSubmit" />
 
file:C:/gibbsd/work/Prospects2/test/cases/prospect.xml:12: Test failed.
Exception raised:
java.lang.NullPointerExceptionjava.lang.NullPointerException
        at
com.canoo.webtest.engine.Context.getResponseFileName(Context.java:88)
        at
com.canoo.webtest.engine.Context.writeLastResponse(Context.java:156)
        at
com.canoo.webtest.engine.Context.setLastResponseAndSaveIfNeeded(Context.java
:135)
        at
com.canoo.webtest.engine.Context.setLastResponseForStep(Context.java:120)
        at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:239)
        at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:186)
        at
com.canoo.webtest.steps.request.ClickLink.doExecute(ClickLink.java:48)
        at com.canoo.webtest.steps.Step.execute(Step.java:59)
        at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
        at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va:63)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
 
thanks
 
David Gibbs
 
IG Index Plc
<?xml:namespace prefix = st1 ns =
"urn:schemas-microsoft-com:office:smarttags" />157-168 Blackfriars Road
Waterloo
London
SE1 8EZ
 

------_=_NextPart_001_01C34C7E.D97A0A30
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Tahoma size=2><SPAN 
class=623145814-17072003>Chaps,</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN 
class=623145814-17072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Tahoma size=2><SPAN class=623145814-17072003>I've got stuck 
trying to submit a form that relies on java script for 
submission.</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN class=623145814-17072003>The link that 
submits the form is of the form.</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2><SPAN 
class=623145814-17072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Tahoma size=2><SPAN class=623145814-17072003>&nbsp;&lt;a 
href="javascript:afSubmit()" 
class="header"&gt;&lt;b&gt;Submit&lt;/b&gt;&amp;nbsp;&lt;img 
src="img/ig_arrow.gif" width="4" height="7" border="0" 
alt=""&gt;&lt;/a&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=623145814-17072003>I can't use 
"clickbutton" (because there isn't one) and I presume "clicklink" isn't 
succeeding from the following stack trace.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=623145814-17072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=623145814-17072003>Are there any 
alternative ways to submit&nbsp;the form ? </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=623145814-17072003>here's the way I 
tried "clicklink"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=623145814-17072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=623145814-17072003>&lt;clicklink 
stepid="Try to submit 
form"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
label="Submit"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
href="afSubmit" /&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=623145814-17072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=623145814-17072003>file:C:/gibbsd/work/Prospects2/test/cases/prospect.xml:12: 
Test failed.<BR>Exception raised: 
java.lang.NullPointerExceptionjava.lang.NullPointerException<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.engine.Context.getResponseFileName(Context.java:88)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.engine.Context.writeLastResponse(Context.java:156)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.engine.Context.setLastResponseAndSaveIfNeeded(Context.java:135)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.engine.Context.setLastResponseForStep(Context.java:120)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:239)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:186)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.steps.request.ClickLink.doExecute(ClickLink.java:48)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.steps.Step.execute(Step.java:59)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.java:63)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Task.perform(Task.java:319)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Target.execute(Target.java:309)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Target.performTasks(Target.java:336)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Project.executeTarget(Project.java:1306)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Task.perform(Task.java:319)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Target.execute(Target.java:309)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Target.performTasks(Target.java:336)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Project.executeTarget(Project.java:1306)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Task.perform(Task.java:319)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Target.execute(Target.java:309)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Target.performTasks(Target.java:336)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Project.executeTarget(Project.java:1306)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Project.executeTargets(Project.java:1250)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Main.runBuild(Main.java:610)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.apache.tools.ant.Main.start(Main.java:196)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
at org.apache.tools.ant.Main.main(Main.java:235)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=623145814-17072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=623145814-17072003>thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial>David Gibbs</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes"></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes">IG Index 
Plc<BR></SPAN></FONT><?xml:namespace prefix = st1 ns = 
"urn:schemas-microsoft-com:office:smarttags" /><st1:Street><st1:address><FONT 
face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes">157-168 
Blackfriars Road</SPAN></FONT></st1:address></st1:Street><FONT face=Arial 
size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes"><BR></SPAN></FONT><st1:City><st1:place><FONT 
face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes">Waterloo</SPAN></FONT></st1:place></st1:City><FONT 
face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes"><BR></SPAN></FONT><st1:City><st1:place><FONT 
face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes">London</SPAN></FONT></st1:place></st1:City><FONT 
face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes"><BR>SE1 
8EZ</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C34C7E.D97A0A30--