[Webtest] ERROR (Step.java:333) - Cannot handle unexpected exception in step Inv

webtest@lists.canoo.com webtest@lists.canoo.com
Fri, 30 Apr 2004 14:01:26 +0200


Hi,

The "java.net.UnknownHostException" is different of the error
"java.nullpointeurexception". UnknowHost means that Web test is unable to find
the file, it can be an error :
- in protocol (you must use "file")
- in host (you must use "")
- in port (you must use "0")
- in the file name (url attribut of invoke) (you must verify it)

the final url used by invoke step is :
protocol://host:port/basepath/url

If you just use the sample file you actually needn't change anything but verify all.

I gave you an example :
<config
   host=""
   port="0"
   protocol="file"
   basepath="C:\WebTest\doc\samples\"
   saveresponse="true"
   haltonerror="true"
   haltonfailure="true"
/>

<invoke stepid="chargement formulaire principal"
        url="testfile.html"/>

I hope this will help you
Lezoul

> I have the same problem but after applying Lezeol's patch, it still doesn't
> work. 
> My config.: ant 1.5.4, webtest build#: 441
> The error message is attached.
> I would appreciate some one could help. Thanks.
> 
> ------ error message ----------
> C:\WebTest\doc\samples>ant -buildfile installTest.xml
> Buildfile: installTest.xml
> 
> checkANT:
> 
> mayPrintANTError:
> 
> checkWebTest:
>      [echo] base dir is C:\WebTest\doc\samples
>  [testSpec] ERROR (Step.java:333) - Cannot handle unexpected exception in
> step I
> nvokePage at  with (stepId="get local file",
> url="C:\WebTest\doc\samples/testfil
> e.html", stepType="invoke")
>  [testSpec] java.net.UnknownHostException: C
>  [testSpec]     at
> java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
>  [testSpec]     at java.net.Socket.connect(Socket.java:452)
>  [testSpec]     at java.net.Socket.connect(Socket.java:402)
>  [testSpec]     at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
>  [testSpec]     at sun.net.NetworkClient.openServer(NetworkClient.java:118)
>  [testSpec]     at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
>  [testSpec]     at sun.net.ftp.FtpClient.<init>(FtpClient.java:692)
>  [testSpec]     at
> sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConne
> ction.java:175)
>  [testSpec]     at
> sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpU
> RLConnection.java:257)
>  [testSpec]     at
> com.meterware.httpunit.HttpWebResponse.getInputStream(HttpWeb
> Response.java:68)
>  [testSpec]     at
> com.meterware.httpunit.HttpWebResponse.<init>(HttpWebResponse
> .java:61)
>  [testSpec]     at
> com.meterware.httpunit.WebConversation.newResponse(WebConvers
> ation.java:61)
>  [testSpec]     at
> com.meterware.httpunit.WebWindow.getResource(WebWindow.java:1
> 62)
>  [testSpec]     at
> com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindo
> w.java:125)
>  [testSpec]     at
> com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:1
> 18)
>  [testSpec]     at
> com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:9
> 9)
>  [testSpec]     at
> com.meterware.httpunit.WebClient.getResponse(WebClient.java:8
> 6)
>  [testSpec]     at
> com.canoo.webtest.steps.request.Target.getResponse(Target.jav
> a:179)
>  [testSpec]     at
> com.canoo.webtest.steps.request.Target$2.call(Target.java:156
> )
>  [testSpec]     at
> com.canoo.webtest.steps.request.Target.protectedGoto(Target.j
> ava:106)
>  [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:193)
>  [testSpec]     at org.apache.tools.ant.Task.perform(Task.java:341)
>  [testSpec]     at org.apache.tools.ant.Target.execute(Target.java:309)
>  [testSpec]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
>  [testSpec]     at
> org.apache.tools.ant.Project.executeTarget(Project.java:1339)
> 
>  [testSpec]     at
> org.apache.tools.ant.Project.executeTargets(Project.java:1255
> )
>  [testSpec]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
>  [testSpec]     at org.apache.tools.ant.Main.start(Main.java:196)
>  [testSpec]     at org.apache.tools.ant.Main.main(Main.java:235)
> 
> BUILD FAILED
> file:C:/WebTest/doc/samples/installTest.xml:10: Test failed.
> Exception raised: com.canoo.webtest.engine.StepExecutionException: Unexpected
> ex
> ception caught: java.net.UnknownHostException: C, Step: InvokePage at  with
> (ste
> pId="get local file", url="C:\WebTest\doc\samples/testfile.html",
> stepType="invo
> ke")com.canoo.webtest.engine.StepExecutionException: Unexpected exception
> caught
> : java.net.UnknownHostException: C, Step: InvokePage at  with (stepId="get
> local
>  file", url="C:\WebTest\doc\samples/testfile.html", stepType="invoke")
>         at
> com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:334)
> 
>         at
> com.canoo.webtest.steps.request.Target.protectedGoto(Target.java:115)
> 
>         at
> com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:153)
>         at
> com.canoo.webtest.steps.request.InvokePage.doExecute(InvokePage.java:
> 37)
>         at com.canoo.webtest.steps.Step.execute(Step.java:99)
>         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:193)
>         at org.apache.tools.ant.Task.perform(Task.java:341)
>         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:1339)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
>         at org.apache.tools.ant.Main.runBuild(Main.java:609)
>         at org.apache.tools.ant.Main.start(Main.java:196)
>         at org.apache.tools.ant.Main.main(Main.java:235)
> 
> 
> Total time: 34 seconds
> C:\WebTest\doc\samples>
> 
> Best Regards,
> CF
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 


--