[Webtest] NPE while building the file

Dierk Koenig webtest@lists.canoo.com
Fri, 21 May 2004 12:42:36 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_002D_01C43F31.184292A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

NPE while building the fileHi

Your Test works fine on my maschine, with the latest build of Canoo WebTest.

Like one would expect, it fails with the following message:

Test step verifytitle named "we should see the login title" failed with
message "Wrong document title found! Expected "L
ogin Page" but got "Yahoo! Help - Yahoo! Account Security""

:-)

Most likely your "resultpath" property points to a non-existing or
write-protected directory.
For a first try, you can suppress storing of response files through the
config step.

cheers
Mittie
  -----Original Message-----
  From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Raghavan, Sankara
Narayanan (Cognizant)
  Sent: Freitag, 21. Mai 2004 10:50
  To: webtest@lists.canoo.com
  Subject: [Webtest] NPE while building the file


  Hello:

  The following exception is raised when trying to build the test.xml

  <<test.xml>>
  C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples>ant -buildfile test.xml
  Buildfile: test.xml

  main:
   [testSpec] ERROR (Step.java:333) - Cannot handle unexpected exception in
step I
  nvokePage at
C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples\test.xml:22:  wi
  th (stepId="get Login Page", url="us/security/index.html",
stepType="invoke")
   [testSpec] java.lang.NullPointerException
   [testSpec]     at
com.canoo.webtest.engine.Context.setLastResponseForStep(Conte
  xt.java:119)
   [testSpec]     at
com.canoo.webtest.steps.request.Target.protectedGoto(Target.j
  ava:119)
   [testSpec]     at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java
  :153)
   [testSpec]     at
com.canoo.webtest.steps.request.InvokePage.doExecute(InvokePa
  ge.java:37)
   [testSpec]     at com.canoo.webtest.steps.Step.execute(Step.java:99)
   [testSpec]     at
com.canoo.webtest.engine.Engine.executeSteps(Engine.java:26)
   [testSpec]     at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpeci
  ficationTask.java:68)
   [testSpec]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
  va:269)
   [testSpec]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [testSpec]     at org.apache.tools.ant.Target.execute(Target.java:301)
   [testSpec]     at
org.apache.tools.ant.Target.performTasks(Target.java:328)
   [testSpec]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1215)

   [testSpec]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1063
  )
   [testSpec]     at org.apache.tools.ant.Main.runBuild(Main.java:632)
   [testSpec]     at org.apache.tools.ant.Main.startAnt(Main.java:183)
   [testSpec]     at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
   [testSpec]     at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

  BUILD FAILED
  C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples\test.xml:13: Test
failed.
  Exception raised: com.canoo.webtest.engine.StepExecutionException:
Unexpected ex
  ception caught: java.lang.NullPointerException, Step: InvokePage at
C:\ToolEvalu
  ation\CanooWebtest\Webtest\doc\samples\test.xml:22:  with (stepId="get
Login Pag
  e", url="us/security/index.html",
stepType="invoke")com.canoo.webtest.engine.Ste
  pExecutionException: Unexpected exception caught:
java.lang.NullPointerException
  , Step: InvokePage at
C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples\test.xm
  l:22:  with (stepId="get Login Page", url="us/security/index.html",
stepType="in
  voke")
          at
com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:334)

          at com.canoo.webtest.steps.Step.execute(Step.java:101)
          at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:26)
          at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecification
  Task.java:68)
          at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
          at org.apache.tools.ant.Task.perform(Task.java:364)
          at org.apache.tools.ant.Target.execute(Target.java:301)
          at org.apache.tools.ant.Target.performTasks(Target.java:328)
          at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
          at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
          at org.apache.tools.ant.Main.runBuild(Main.java:632)
          at org.apache.tools.ant.Main.startAnt(Main.java:183)
          at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
          at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)



  Total time: 20 seconds

------=_NextPart_000_002D_01C43F31.184292A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>NPE while building the file</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =
size=3D2>Your=20
Test works fine on my maschine, with the latest build of Canoo=20
WebTest.</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =
size=3D2>Like=20
one would expect, it fails with the following =
message:</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =
size=3D2>Test=20
step verifytitle named "we should see the login title" failed with =
message=20
"Wrong document title found! Expected "L<BR>ogin Page" but got "Yahoo! =
Help -=20
Yahoo! Account Security""</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2>:-)</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =
size=3D2>Most=20
likely your "resultpath" property points to a non-existing or =
write-protected=20
directory.</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =
size=3D2>For a=20
first try, you can suppress storing of response files through the config =

step.</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2>cheers</FONT></SPAN></DIV>
<DIV><SPAN class=3D261503310-21052004><FONT face=3DArial color=3D#0000ff =

size=3D2>Mittie</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com]<B>On=20
  Behalf Of </B>Raghavan, Sankara Narayanan (Cognizant)<BR><B>Sent:</B> =
Freitag,=20
  21. Mai 2004 10:50<BR><B>To:</B> =
webtest@lists.canoo.com<BR><B>Subject:</B>=20
  [Webtest] NPE while building the file<BR><BR></FONT></DIV><!-- =
Converted from text/rtf format -->
  <P><FONT face=3DArial size=3D2>Hello:</FONT> </P>
  <P><FONT face=3DArial size=3D2>The following exception is raised when =
trying to=20
  build the test.xml</FONT> </P>
  <P><FONT face=3DArial color=3D#000000 =
size=3D2>&lt;&lt;test.xml&gt;&gt;=20
  </FONT><BR><FONT face=3DArial=20
  size=3D2>C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples&gt;ant =
-buildfile=20
  test.xml</FONT> <BR><FONT face=3DArial size=3D2>Buildfile: =
test.xml</FONT> </P>
  <P><FONT face=3DArial size=3D2>main:</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec] ERROR (Step.java:333) - Cannot handle =
unexpected=20
  exception in step I</FONT> <BR><FONT face=3DArial size=3D2>nvokePage =
at=20
  C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples\test.xml:22:&nbsp;=20
  wi</FONT> <BR><FONT face=3DArial size=3D2>th (stepId=3D"get Login =
Page",=20
  url=3D"us/security/index.html", stepType=3D"invoke")</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;[testSpec] java.lang.NullPointerException</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.engine.Context.setLastResponseForStep(Conte</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>xt.java:119)</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.steps.request.Target.protectedGoto(Target.j</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>ava:119)</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.steps.request.Target.gotoTarget(Target.java</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>:153)</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.steps.request.InvokePage.doExecute(InvokePa</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>ge.java:37)</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.steps.Step.execute(Step.java:99)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.engine.Engine.executeSteps(Engine.java:26)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpeci</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>ficationTask.java:68)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>va:269)</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Task.perform(Task.java:364)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Target.execute(Target.java:301)</FONT> <BR><FONT=20
  face=3DArial size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Target.performTasks(Target.java:328)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Project.executeTarget(Project.java:1215)</FONT> =
</P>
  <P><FONT face=3DArial =
size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Project.executeTargets(Project.java:1063</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>)</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Main.runBuild(Main.java:632)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Main.startAnt(Main.java:183)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)</FONT> =
</P>
  <P><FONT face=3DArial size=3D2>BUILD FAILED</FONT> <BR><FONT =
face=3DArial=20
  =
size=3D2>C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples\test.xml:13: =
Test=20
  failed.</FONT> <BR><FONT face=3DArial size=3D2>Exception raised:=20
  com.canoo.webtest.engine.StepExecutionException: Unexpected ex</FONT>=20
  <BR><FONT face=3DArial size=3D2>ception caught: =
java.lang.NullPointerException,=20
  Step: InvokePage at C:\ToolEvalu</FONT> <BR><FONT face=3DArial=20
  size=3D2>ation\CanooWebtest\Webtest\doc\samples\test.xml:22:&nbsp; =
with=20
  (stepId=3D"get Login Pag</FONT> <BR><FONT face=3DArial size=3D2>e",=20
  url=3D"us/security/index.html",=20
  stepType=3D"invoke")com.canoo.webtest.engine.Ste</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>pExecutionException: Unexpected exception caught:=20
  java.lang.NullPointerException</FONT> <BR><FONT face=3DArial =
size=3D2>, Step:=20
  InvokePage at=20
  C:\ToolEvaluation\CanooWebtest\Webtest\doc\samples\test.xm</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>l:22:&nbsp; with (stepId=3D"get Login Page",=20
  url=3D"us/security/index.html", stepType=3D"in</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>voke")</FONT> <BR><FONT face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  =
com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:334)</FO=
NT>=20
  </P>
  <P><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.steps.Step.execute(Step.java:101)</FONT> <BR><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  com.canoo.webtest.engine.Engine.executeSteps(Engine.java:26)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  =
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecification</FO=
NT>=20
  <BR><FONT face=3DArial size=3D2>Task.java:68)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  =
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)</FON=
T>=20
  <BR><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Task.perform(Task.java:364)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Target.execute(Target.java:301)</FONT> <BR><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Target.performTasks(Target.java:328)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Project.executeTarget(Project.java:1215)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Project.executeTargets(Project.java:1063)</FONT>=20
  <BR><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Main.runBuild(Main.java:632)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.Main.startAnt(Main.java:183)</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
  org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)</FONT> =
</P><BR>
  <P><FONT face=3DArial size=3D2>Total time: 20 seconds</FONT>=20
</P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_002D_01C43F31.184292A0--