• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Testing well-formedness of HTML

 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I test well-formedness of my HTML document produced by Struts/Velocity?

TIA,
- Manish
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTML is not a well-formed markup language - so I'm not sure what you need to test. If you are worried about whether HTML is well-formed in the way XHTML is, then a quick test is save the document as XML and open it in IE.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For testing XHTML for well-formedness and correctness against the official DTD, you can use XHTMLUnit: http://sf.net/projects/xhtmlunit
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have HTTP-UNIT and I was trying to test this with it, but am not too familiar with these tools, so don't know how exactly I can test it. Especially trying to understand how can I get the resultant HTML in my test by passing the parameters to struts action.

rgds,
- Manish
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Manish Hatwalne:
I have HTTP-UNIT and I was trying to test this with it, but am not too familiar with these tools, so don't know how exactly I can test it. Especially trying to understand how can I get the resultant HTML in my test by passing the parameters to struts action.


I would suggest reading the cookbook to get started with the basics and then examining the API to figure out what kind of things you can do with certain types of objects.

For example, the WebResponse#getInputStream() method would probably be relevant for you if you need to access the raw HTML source code produced by your web application (excluding HTTP headers).
 
reply
    Bookmark Topic Watch Topic
  • New Topic