I'm using Selenium to test my application. A nice test would be that after every DOM manipulation I would validate the DOM. Is there a nice way to do this?
Obvious ways are:
DOM in Selenium WebDriver is an essential component of web development using HTML5 and JavaScript. The full form of DOM is Document Object Model. DOM is not a computer science concept. It is a simple set of interfaces standardized among web developers to access and manipulate documents in HTML or XML using JavaScript.
DOM stands for Document Object Model. In simple words, DOM specifies the structural representation of HTML elements. There are four ways through which we can identify and locate a web element using DOM. getElementById.
The Document Object Model (DOM, see [DOM]) is a platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of HTML and XML documents.
There is no built in process for doing this using Selenium. There is however a Open Source project that is built on WebDriver, WebDriver is becoming Selenium 2, that allows you to do layout testing.
The project is at http://code.google.com/p/fighting-layout-bugs/ and was first shown at GTAC 2009 in Zurich. The code uses W3C and jQuery to check the validity of the DOM. Have a look at the video of the talk and the code that is there.
EDIT:
Thanks to sampablokuper the W3C validation is at code.google.com/p/w3c-markup-validation-filter/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With