Has anyone tried to test the page layout of a website using webdriver? To be specific, using webelement.getPosition() and webelement.getDimension().
Shouldn't these two methods be enough for testing the layout of the page. I did a quick test and found that the location would return the location of the element relative to the left top corner of the page. That means this should always return the same value irrespective of monitor resolution or window size.
If I can record the location and element dimension once and store those values somewhere, I can run automated tests using selenium to find whether the position or dimension of the element changed. If that change is greater than a delta value which I set, then it means the alignment of the element has changed and I can fail the test.
I am planning to create some utility program which does this, but wanted to confirm that this would indeed be enough to test the page layout