Need to validate the HTML tags using QTP

463 Views Asked by At

I have a situation here and need your suggestion, Through QTP or UFT, I need to validate a page from HTML point of view.

To be in detail, Assume that there is a snippet of HTML ,(like test test>). Now QTP should read the text ( which I can do using the :innerhtml property) and then say that the snippet is valid. Basically I am not really worried of the content , But the HTML tags should be validated and they need to be syntaxically correct.

Any help would be appreciated.

1

There are 1 best solutions below

1
On

Get elements that interest you by Description create, and then check outerhtml of every object. If you want to make everything from nothing (I think so, if you are not using existing validators) , you will have to write your own parser that counts brackets, quotation marks, etc. Basing on regexp you have to check semantics after every defined word as title. Lot of work with regexp... and not only regexp...

Simpler, but "dirty" solution: copy what you have, open new tab with html validator, paste, check output :D

Edit: after long research I found an article on HP blog (the future of testing blog) that might be helpful in solving this type of problems: link