2

I was wondering how one would attempt to compare the rendering of a website in various browsers via an algorithm in order to detect incompatibilities (e.g. floats etc.), just like browsera.

1 Answer 1

1

You could attempt to parse the and HTML and CSS and look for known problems, like a ‘lint’ tool. But there are so very many browser bugs (esp. IE6 layout bugs) that you'd be unlikely to find everything that way.

The other way would be to load actual instances of each of the target browsers and script them to load the given URL. You could then inject JavaScript to walk their DOMs reading the page-relative positions of each element (using the offset*properties), and flag any elements whose positions/dimensions vary greatly between browsers. You'd also want to catch and record any unhandled JS errors thrown, perhaps through window.onerror.

Sign up to request clarification or add additional context in comments.

1 Comment

It's been five years almost to the day: does anyone know of a product that implements the algorithm @bobince describes here? Seems like it would be even more useful these days where dynamic JS front end frameworks create HTML that is difficult for traditional automated web testing tools like Selenium to consume.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.