Simple checks of contents of websites, portals and web based applications displayed in a browser could be done by comparing screenshots (both content and geometry).
But this should never be the usual way, as these checks are statical. These kinds of tests are only legitimate for testing the layout as a whole (e.g. for assurance of the compliance to a given CD).
In this case, all tests will fail after changes of a website layout (compared with the status of the content page at the time of recording of this check) even if the layout has not really changed and only a value of table cell was altered. To avoid this, you might have to figure out all preconditions and ensure them prior to the test.
The tests are complicated by a number of various browser differences. For instance there is a known problem of the IE6 when rendering images in png format; IE7/IE8 can render the content optionally by the use of Clear Type. Under Windows Vista you can configure the use of Clear Type both for browser and operating system. But there are also differences in the rendering of content by the various versions of Windows (even the geometry is lightly diverging!). If your tests will be more extensive and include Firefox or Seamonkey, additional differences in rendering between the manufactures of the browsers will come along. The differences between IE and Seamonky/Firefox will be amplified by processing of invalid HTML (from the user perspective this fact can be disregarded, as long as all content can be displayed without an error message).
Web2test avoids this nightmare due the usage of different heuristics for component recognition during runtime of a test. These heuristics can easily be customized. Thus, changes on the layout are basically no reason for the failing of a test. In contrast, image checks and geometry checks are strictly bound to the layout. At this point, heuristics cannot and should not assist. The solution is the usage of the various nodes of control structures (e.g. If, Else, etc.) in combination with the variable browser to distinguish between IE/Mozilla (recommended to instantiate at the “browser start” node), the procedure isIE6() and a small server script getCurrentOS() (see below).
from java.lang import System
os = System.getProperty(”os.name”);
rc.setGlobal(”CurrentOS”, os)
This allows the universal implementation of test scripts with all combinations of possible eventualities. Following a schematic illustration of a possible flow control:










