views:

29

answers:

2

Has any one tried testing the actual layout of the web application in different browsers? I can only think of getting the actual dimensions of all the elements and then matching it with expected values. I think it is crude way to do it. Is there a better way to actually test the layout?

Thanks Bharani

A: 

What do you plan to test? If you need to know whether an element is flush with the border of the window, clientLeft == 0 is the best option. If you want to make sure two elements are next to each other, you must compare the position of the common border.

OTOH, it doesn't make much sense to check every single value. Layout can be dynamic, and depend on factors like screen resolution, zoom factor and base font size. So the golden rule (as always) is: Know what you want to test and then test just that.

Aaron Digulla
yes that is the reason i thought it was crude. But i am not sure if you can detect overlap or wrong layout if you don't include everything element.
Bharani
In my tests, I create a static HTML version of all important pages, so I can load them in a web browser and check the layout for any big oddities. When I find one, I add a test. But since most things will work, there is no reason to test everything.
Aaron Digulla
A: 

I’ve never tried this, but I think it’s much more effort than it’s worth.

Layout issues are only important if they’re obvious, and if they’re obvious, human beings will spot them with much less effort than it would take to write and maintain scripts that check the same thing.

Also, layout issues are never that important. They don’t result in user data being lost, for example.

Paul D. Waite
Of course it is not end of world. But people DO judge the quality of your site mostly on the usability, look and feel
Bharani
Oh indeed, it’s just that setting up programmatical testing of look and feel (of this kind, at least) is *so* time-consuming that it wouldn’t work. Your layout is likely to change faster than you can update the tests. I have wondered whether a tool that took and diffed screenshots might work. It’d have to ignore areas of the page that have varying content somehow.
Paul D. Waite
Paul D. Waite