lunes, 6 de julio de 2015

Custom Report


In this part we will create a custom report , this will read it since testng-result.xml report. The result will generate an excel file. 


DocumentBuilderFactory

Defines a factory API
that enables applications to obtain a parser that produces DOM object trees from XML documents.

DocumentBuilderFactory fact= DocumentBuilderFactory.newInstance();

NewDocumentBuilder()

DocumentBuilder build= fact.newDocumentBuilder();
Creates a new instance of a DocumentBuilder using the currently configured parameters.
Defines the API to obtain DOM Document instances from an XML document. Using this class, an application programmer can obtain a Document from XML.
An instance of this class can be obtained from the DocumentBuilderFactory.newDocumentBuilder() method. Once an instance of this class is obtained, XML can be parsed from a variety of input sources. These input sources are InputStreams, Files, URLs, and SAX InputSources.

Note that this class reuses several classes from the SAX API. This does not require that the implementor of the underlying DOM implementation use a SAX parser to parse XML document into a Document. It merely requires that the implementation communicate with the application using these existing APIs.


Parse(file):
Parse the content of the given file as an XML document and return a new DOM Document object.
  Document doc=build.parse(xmlFile);


























No hay comentarios:

Publicar un comentario