[Webtest] verifytitle problem

Sandro Pedrazzini webtest@lists.canoo.com
Tue, 16 Apr 2002 10:25:09 +0200


Hello Dierk,

A student of mine whom I asked to test a web site using CanooWebTest 
had a problem. I know I should grab myself into the code, but I am 
not really working with it.
It seems that WebTest throws an exception when there is a URL redirection.

Following Test:

<testSpec name="checking  site">
   <config
      host="www.die.supsi.ch"
      protocol="http"
      verbose = "true"
      summary = "true"
    />
    <steps>
       <invoke  stepid="get main page"  url="index.html" />
       <verifytitle  stepid="check the title"  text="abc..." />
    </steps>
</testSpec>

Generates following exception (used with other sites the result is OK).
My interpretation is that the redirection causes somewhere a null 
reference, i.e. there should be a null check somewhere.
Here the exception stack:

Error encountered: checking 
site(com.canoo.webtest.engine.ConfigurableTestCase): null
Exception raised: java.lang.NullPointerExceptionjava.lang.NullPointerException
         at 
com.canoo.webtest.steps.VerifyElementText.getTextFromNode(VerifyElementText.java:176)
         at 
com.canoo.webtest.steps.VerifyElementText.doExecute(VerifyElementText.java:145)
         at 
com.canoo.webtest.steps.AbstractTestStepSpecification.execute(AbstractTestStepSpecification.java:62)
         at 
com.canoo.webtest.engine.ConfigurableTestCase.runTest(ConfigurableTestCase.java:40)
         at junit.framework.TestCase.runBare(TestCase.java:129)
         at junit.framework.TestResult$1.protect(TestResult.java:100)
         at junit.framework.TestResult.runProtected(TestResult.java:117)
         at junit.framework.TestResult.run(TestResult.java:103)
         at junit.framework.TestCase.run(TestCase.java:120)
         at junit.framework.TestCase.run(TestCase.java:113)
         at 
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.java:54)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
         at org.apache.tools.ant.Task.perform(Task.java:217)
         at org.apache.tools.ant.Target.execute(Target.java:184)
         at org.apache.tools.ant.Target.performTasks(Target.java:202)
         at org.apache.tools.ant.Project.executeTarget(Project.java:601)
         at org.apache.tools.ant.Project.executeTargets(Project.java:560)
         at org.apache.tools.ant.Main.runBuild(Main.java:454)
         at org.apache.tools.ant.Main.start(Main.java:153)
         at org.apache.tools.ant.Main.main(Main.java:176)



And then another problem I ancountered some weeks ago.Last time I 
asked you whether there is a timeout in HttpUnit when checking the 
links, because following link http://www.let.vu.nl/, which exists, 
when checked as link (verifylink) with CanooWebTest, sometimes 
returns following error message:

Failure: checking WordManager.com 
site(com.canoo.webtest.engine.ConfigurableTestCase): Step "Check 
links..." (4/7): broken Link(s) : http://www.let.vu.nl/ on 
http://www.wordmanager.com:80/welcome.html;


Thank you and best regards
Sandro