|What is Doctype in web testing?Add caption|
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.
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
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.
How to Test HTML-5 Webpages?
HTML-5 have come up with lot more modifications on the deceleration portion. It is really nice for the developer and test engineer.
But we need to test for
- Remember the HTML-4 and less will have …syntax like <link type=”text/css” rel=”stylesheet” href=”abc.css”> but in HTML 5 <link rel=”stylesheet” href=”lounge.css”>
- HTML 4 will have -<script src=”lounge.js”></script> but HTML-5 will have only <Script></Script>
- Meta tag in HTML 4 or less is <meta http-equiv=”content-type” content=”text/html; charset=UTF-8″> but in HTML-5<meta charset=“utf-8″>
- There is an existence of XHTML in HTML 4 or less but HTML 5 does not have that.