From: vamsidhar s. <bva...@ya...> - 2007-11-16 15:26:58
|
Thanks Stefan.=0AThe qualifier works for me. Actually I had overridden it w= rongly with some other qualifier.=0A=0A[not identical] Expected number of c= hild nodes '4' but was '3' - comparing <div...> at /html[1]/body[1]/div[1] = to <div...> at /html[1]/body[1]/div[1]=0A[different] Expected element tag n= ame 'x' but was 'div' - comparing <x...> at /html[1]/body[1]/div[1]/x[1] to= <div...> at /html[1]/body[1]/div[1]/div[1]=0A[not identical] Expected numb= er of element attributes '0' but was '1' - comparing <x...> at /html[1]/bod= y[1]/div[1]/x[1] to <div...> at /html[1]/body[1]/div[1]/div[1]=0A[not ident= ical] Expected attribute name 'null' but was 'class' - comparing <x...> at = /html[1]/body[1]/div[1]/x[1] to <div...> at /html[1]/body[1]/div[1]/div[1]= =0A[different] Expected presence of child nodes to be 'false' but was 'true= ' - comparing <x...> at /html[1]/body[1]/div[1]/x[1] to <div...> at /html[1= ]/body[1]/div[1]/div[1]=0A[not identical] Expected sequence of child nodes = '0' but was '1' - comparing <x...> at /html[1]/body[1]/div[1]/x[1] to <div.= ..> at /html[1]/body[1]/div[1]/div[1]=0A[not identical] Expected attribute = value '1232' but was '123' - comparing <a href=3D"1232"...> at /html[1]/bod= y[1]/div[1]/a[1]/@href to <a href=3D"123"...> at /html[1]/body[1]/div[1]/a[= 1]/@href=0A[not identical] Expected sequence of child nodes '1' but was '0'= - comparing <a...> at /html[1]/body[1]/div[1]/a[1] to <a...> at /html[1]/b= ody[1]/div[1]/a[1]=0A[not identical] Expected attribute value 'top' but was= 'bottom' - comparing <div class=3D"top"...> at /html[1]/body[1]/div[1]/div= [1]/@class to <div class=3D"bottom"...> at /html[1]/body[1]/div[1]/div[2]/@= class=0A[not identical] Expected text value 'top' but was 'bottom' - compar= ing <div ...>top</div> at /html[1]/body[1]/div[1]/div[1]/text()[1] to <div = ...>bottom</div> at /html[1]/body[1]/div[1]/div[2]/text()[1]=0A[not identic= al] Expected sequence of child nodes '3' but was '2' - comparing <div...> a= t /html[1]/body[1]/div[1]/div[2] to <div...> at /html[1]/body[1]/div[1]/div= [2]=0A=0A=0A=0A----- Original Message ----=0AFrom: Stefan Bodewig <bodewig@= apache.org>=0ATo: xml...@li...=0ASent: Friday, 16 = November, 2007 8:27:21 PM=0ASubject: Re: [Xmlunit-general] Missing elements= =0A=0AOn Fri, 16 Nov 2007, vamsidhar sharma <bva...@ya...> wrote:= =0A> Hi xmlunit users,=0A> =0A> Had a question regarding the behaviour of X= MLUnit in the below=0A> scenario:=0A> =0A> Control Doc =3D =0A> <div class= =3D"main">=0A> <x/>=0A> <a href=3D"1232"/>=0A> <div class=3D"to= p">top</div>=0A> <div class=3D"bottom">bottom</div>=0A> </div>=0A> =0A>= Test Doc =3D=0A> <div class=3D"main">=0A> <a href=3D"123"/>=0A> <d= iv class=3D"top">top</div>=0A> <div class=3D"bottom">bottom</div>=0A> <= /div>=0A> =0A> Looking at the docs. it is clear that 'x' tag is missing in = test=0A> doc. Below is the report that XMLUnit that is generated.=0A> From= 2nd line I could infer that 'x' is missing element.=0A> However, when cont= rol reaches 'a' in control doc. it is compared=0A> with 'div' in test doc.= =0A=0A=0ABy default XMLUnit matches each node in the control document again= st=0Athe node that appears "at the same place" in the test document. What= =0Ayou want is that XMLUnit compares elements with the closest element=0Ath= at has the same name. To achieve that, you want to use an=0AElementNameQua= lifier, see=0A<http://xmlunit.sourceforge.net/userguide/html/ar01s03.html#E= lementQualifier>.=0A=0AStefan=0A=0A----------------------------------------= ---------------------------------=0AThis SF.net email is sponsored by: Micr= osoft=0ADefy all challenges. Microsoft(R) Visual Studio 2005.=0Ahttp://clk.= atdmt.com/MRT/go/vse0120000070mrt/direct/01/=0A____________________________= ___________________=0AXmlunit-general mailing list=0AXmlunit-general@lists.= sourceforge.net=0Ahttps://lists.sourceforge.net/lists/listinfo/xmlunit-gene= ral=0A=0A=0A=0A=0A=0A Now you can chat without downloading messenger. = Go to http://in.messenger.yahoo.com/webmessengerpromo.php |