Header Ads

Importance of Doctype in web testing

While testing a web ,we generally ignore the the page deceleration part also.No interviewer asks about doc type of web page to test engineers and developer!!!!!.More over while developing a web application this part is untold.
True ....we generally ignore this very important part.

Well what does it mean??

From the very beginning of the internet,web rather the HTML has changed a lot. It is really an old language having lot more wrapper on it. When these wrappers are applied on web pages, It became impossible to track. On the other HTML parser of a browser became puzzled what kind of HTML content is there, which is going to be displayed.
With advancement of technology the electronic devices like-pad,tablet,mobile etc are able to browse the internet. A browser may/may not purse some HTML command which is not proper but these devices are not.
So the web became machine/browser dependent to display it's content correctly.

Hence W3school came with some proper standard for each version upgrade of HTML.
How it is looking like--

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
and in HTML-5
<!doctype html>
where it is upfront telling the browser/device that this page talks about a html type whose version is 4.01.
and it is taking a public standard,Its markup language is English(EN). It is also giving the address of the standard file where all the standard resides. Doc type the browser is able to be more precise in the way it interprets and renders your pages. Using a doc type is highly recommended but not mandate.

But I strongly advice that there should be some test cases to cover  these part. And i strongly suggest that this doc type should be there.

What will be a test engineers responsibility  if a page does not have a doc type?

Well, If this is not documented in Requirement specification ,Test engineers need to have a discussion with the module /application owner regarding the same. Make them understand what could be the problem if a page does not have a doc type.
These points may help you during discussion-
1.In general a browser internally call HTML 4 quick mode if it does not have a doc type. As a result, this can show your content but fails when cross browser testing happening.
2.Internet capable devices may  not show the page content correctly.
3.HTML validator tool can not perform a code check activity on the page.
4. The style sheet may not support.
5. If doc type is not declared the browser will render the page as quick doc type mode(by default) ,which may not satisfy all your beautiful code.
No user/customer can avoid this point.

Powered by Blogger.