[Webtest] BUG? Exception in JTidy

Dierk Konig Dierk.Koenig@canoo.com
Sat, 2 Mar 2002 14:15:19 +0100


Hi Ugo,

you are right that this is a jtidy parsing issue. The question remains
whether jtidy or the html is the problem.

Have you tried to validate the document e.g. by
http://validator.w3.org/file-upload.html?

I'm not sure about the HTML version, for the code does not state it
explicitely.

Try to separate the test for "h2" from the test for "td" to get closer to
the defect.

If it's "td" try to use verifyelement with a nested TableLocator. The
validator will take issue with the "name" attribute of the td. You can use
"id" instead. That is valid html4.01 and webtest deals with both.

pls send your findings to the list.

cheers
Dierk

----

I have this problem when using verifyelementtext:

Error encountered:
incspe(com.canoo.webtest.engine.ConfigurableTestCase): null
Exception raised:
java.lang.NegativeArraySizeExceptionjava.lang.NegativeArraySizeException
 at org.w3c.tidy.Node.clone(Node.java:136)
 at org.w3c.tidy.Node.cloneNode(Node.java:889)
 at org.w3c.tidy.Node.cloneNode(Node.java:896)
 at org.w3c.tidy.Node.cloneNode(Node.java:896)
 at org.w3c.tidy.Node.cloneNode(Node.java:896)
 at org.w3c.tidy.Node.cloneNode(Node.java:896)
 at org.w3c.tidy.Node.cloneNode(Node.java:896)
 at org.w3c.tidy.Node.cloneNode(Node.java:896)
 at org.w3c.tidy.DOMNodeImpl.cloneNode(DOMNodeImpl.java:400)
 at com.meterware.httpunit.ParsedHTML.getDOM(ParsedHTML.java:245)
 at com.meterware.httpunit.WebResponse.getDOM(WebResponse.java:356)
 at com.canoo.webtest.steps.Verify.getAllElementsOfType(Verify.java:71)
 at
com.canoo.webtest.steps.VerifyElementText.doExecute(VerifyElementText.java:1
19)
 at
com.canoo.webtest.steps.AbstractTestStepSpecification.execute(AbstractTestSt
epSpecification.java:62)
 at com.canoo.webtest.engine.ConfigurableTestCase.runTest(ConfigurableTes
tCase.java:40)
 at junit.framework.TestCase.runBare(TestCase.java:140)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:131)
 at junit.framework.TestCase.run(TestCase.java:124)
 at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va: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)

This error appears whenever I use a verifyelementtext. These are the
elements that I am currently using:

 <verifyelementtext stepid="verify title" type="h2" text="INCIDENZA DI
SPESA SUL TOTALE BENI E SERVIZI"/>
 <verifyelementtext stepid="verify amount" type="td" name="imptot"
text="1.174.037.787"/>

Attached, you can find the response file that is being tested.

 Ugo