1*83a54b2fSSadaf Ebrahimi<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2*83a54b2fSSadaf Ebrahimi 3*83a54b2fSSadaf Ebrahimi<html> 4*83a54b2fSSadaf Ebrahimi <head> 5*83a54b2fSSadaf Ebrahimi <title>DTD for TestNG 1.0</title> 6*83a54b2fSSadaf Ebrahimi <link rel="stylesheet" href="http://beust.com/beust.css" type="text/css"/> 7*83a54b2fSSadaf Ebrahimi </head> 8*83a54b2fSSadaf Ebrahimi<body> 9*83a54b2fSSadaf Ebrahimi 10*83a54b2fSSadaf Ebrahimi<pre class="code"><span class="xml-comment"><!-- 11*83a54b2fSSadaf Ebrahimi 12*83a54b2fSSadaf EbrahimiHere is a quick overview of the main parts of this DTD. For more information, 13*83a54b2fSSadaf Ebrahimirefer to the <a <span class="attribute">href="http://testng.org"</span> >main web site<span class="tag"></a>. 14*83a54b2fSSadaf Ebrahimi 15*83a54b2fSSadaf Ebrahimi</span> 16*83a54b2fSSadaf EbrahimiA <span class="tag"><b>suite</b></span> is made of <span class="tag"><b>tests</b></span> and <span class="tag"><b>parameters</b>. 17*83a54b2fSSadaf Ebrahimi</span> 18*83a54b2fSSadaf Ebrahimi 19*83a54b2fSSadaf EbrahimiA <span class="tag"><b>test</b></span> is made of three parts: 20*83a54b2fSSadaf Ebrahimi 21*83a54b2fSSadaf Ebrahimi<span class="tag"><ul> 22*83a54b2fSSadaf Ebrahimi<li></span> <span class="tag"><b>parameters</b>,</span> which override the suite parameters 23*83a54b2fSSadaf Ebrahimi<span class="tag"><li></span> <span class="tag"><b>groups</b>,</span> made of two parts 24*83a54b2fSSadaf Ebrahimi 25*83a54b2fSSadaf Ebrahimi<span class="tag"><li></span> <span class="tag"><b>classes</b>,</span> defining which classes are going to be part 26*83a54b2fSSadaf Ebrahimi of this test run 27*83a54b2fSSadaf Ebrahimi<span class="tag"></ul> 28*83a54b2fSSadaf Ebrahimi</span> 29*83a54b2fSSadaf EbrahimiIn turn, <span class="tag"><b>groups</b></span> are made of two parts: 30*83a54b2fSSadaf Ebrahimi 31*83a54b2fSSadaf Ebrahimi<span class="tag"><ul> 32*83a54b2fSSadaf Ebrahimi<li></span> Definitions, which allow you to group groups into 33*83a54b2fSSadaf Ebrahimi bigger groups 34*83a54b2fSSadaf Ebrahimi<span class="tag"><li></span> Runs, which defines the groups that the methods 35*83a54b2fSSadaf Ebrahimi must belong to in order to be run during this test 36*83a54b2fSSadaf Ebrahimi<span class="tag"></ul> 37*83a54b2fSSadaf Ebrahimi</span> 38*83a54b2fSSadaf EbrahimiCedric Beust & Alexandru Popescu 39*83a54b2fSSadaf Ebrahimi@title DTD for TestNG 40*83a54b2fSSadaf Ebrahimi@root suite 41*83a54b2fSSadaf Ebrahimi 42*83a54b2fSSadaf Ebrahimi--></span> 43*83a54b2fSSadaf Ebrahimi 44*83a54b2fSSadaf Ebrahimi 45*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- A suite is the top-level element of a testng.xml file --></span> 46*83a54b2fSSadaf Ebrahimi 47*83a54b2fSSadaf Ebrahimi<!ELEMENT suite (listeners|packages|test|parameter|method-selectors|suite-files)* > 48*83a54b2fSSadaf Ebrahimi 49*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- Attributes: --></span> 50*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- 51*83a54b2fSSadaf Ebrahimi@attr name The name of this suite (as it will appear in the reports) 52*83a54b2fSSadaf Ebrahimi@attr junit Whether to run in JUnit mode. 53*83a54b2fSSadaf Ebrahimi@attr verbose How verbose the output on the console will be. 54*83a54b2fSSadaf Ebrahimi This setting has no impact on the HTML reports. 55*83a54b2fSSadaf Ebrahimi@attr parallel Whether TestNG should use different threads 56*83a54b2fSSadaf Ebrahimi to run your tests (might speed up the process) 57*83a54b2fSSadaf Ebrahimi@attr configfailurepolicy Whether to continue attempting Before/After 58*83a54b2fSSadaf Ebrahimi Class/Methods after they've failed once or just skip remaining. 59*83a54b2fSSadaf Ebrahimi@attr thread-count An integer giving the size of the thread pool to use 60*83a54b2fSSadaf Ebrahimi if you set parallel. 61*83a54b2fSSadaf Ebrahimi@attr annotations If "javadoc", TestNG will look for 62*83a54b2fSSadaf Ebrahimi JavaDoc annotations in your sources, otherwise it will 63*83a54b2fSSadaf Ebrahimi use JDK5 annotations. 64*83a54b2fSSadaf Ebrahimi@attr time-out The time to wait in milliseconds before aborting the 65*83a54b2fSSadaf Ebrahimi method (if <span class="attribute">parallel="methods"</span> ) or the test (parallel="tests") 66*83a54b2fSSadaf Ebrahimi@attr skipfailedinvocationCounts Whether to skip failed invocations. 67*83a54b2fSSadaf Ebrahimi@attr data-provider-thread-count An integer giving the size of the thread pool to use 68*83a54b2fSSadaf Ebrahimi for parallel data providers. 69*83a54b2fSSadaf Ebrahimi@attr object-factory A class that implements IObjectFactory that will be used to 70*83a54b2fSSadaf Ebrahimi instantiate the test objects. 71*83a54b2fSSadaf Ebrahimi--></span> 72*83a54b2fSSadaf Ebrahimi<!ATTLIST suite 73*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED 74*83a54b2fSSadaf Ebrahimi junit (true | false) "false" 75*83a54b2fSSadaf Ebrahimi verbose CDATA #IMPLIED 76*83a54b2fSSadaf Ebrahimi parallel (false | methods | tests | classes) "false" 77*83a54b2fSSadaf Ebrahimi configfailurepolicy (skip | continue) "skip" 78*83a54b2fSSadaf Ebrahimi thread-count CDATA "5" 79*83a54b2fSSadaf Ebrahimi annotations CDATA #IMPLIED 80*83a54b2fSSadaf Ebrahimi time-out CDATA #IMPLIED 81*83a54b2fSSadaf Ebrahimi skipfailedinvocationCounts (true | false) "false" 82*83a54b2fSSadaf Ebrahimi data-provider-thread-count CDATA "10" 83*83a54b2fSSadaf Ebrahimi object-factory CDATA #IMPLIED 84*83a54b2fSSadaf Ebrahimi> 85*83a54b2fSSadaf Ebrahimi 86*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- A list of XML files that contain more suite descriptions --></span> 87*83a54b2fSSadaf Ebrahimi<!ELEMENT suite-files (suite-file)* > 88*83a54b2fSSadaf Ebrahimi 89*83a54b2fSSadaf Ebrahimi<!ELEMENT suite-file ANY > 90*83a54b2fSSadaf Ebrahimi<!ATTLIST suite-file 91*83a54b2fSSadaf Ebrahimi path CDATA #REQUIRED 92*83a54b2fSSadaf Ebrahimi> 93*83a54b2fSSadaf Ebrahimi 94*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- 95*83a54b2fSSadaf EbrahimiParameters can be defined at the <span class="tag"><suite></span> or at the <span class="tag"><test></span> level. 96*83a54b2fSSadaf EbrahimiParameters defined at the <span class="tag"><test></span> level override parameters of the same name in <span class="tag"><suite> 97*83a54b2fSSadaf Ebrahimi 98*83a54b2fSSadaf EbrahimiParameters</span> are used to link Java method parameters to their actual value, defined here. 99*83a54b2fSSadaf Ebrahimi--></span> 100*83a54b2fSSadaf Ebrahimi<!ELEMENT parameter ANY> 101*83a54b2fSSadaf Ebrahimi<!ATTLIST parameter 102*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED 103*83a54b2fSSadaf Ebrahimi value CDATA #REQUIRED > 104*83a54b2fSSadaf Ebrahimi 105*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- 106*83a54b2fSSadaf EbrahimiMethod selectors define user classes used to select which methods to run. 107*83a54b2fSSadaf EbrahimiThey need to implement <span class="tag"><tt>org.testng.IMethodSelector</tt></span> 108*83a54b2fSSadaf Ebrahimi--></span> 109*83a54b2fSSadaf Ebrahimi<!ELEMENT method-selectors (method-selector*) > 110*83a54b2fSSadaf Ebrahimi 111*83a54b2fSSadaf Ebrahimi<!ELEMENT method-selector ((selector-class)*|script) > 112*83a54b2fSSadaf Ebrahimi<!ELEMENT selector-class ANY> 113*83a54b2fSSadaf Ebrahimi<!ATTLIST selector-class 114*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED 115*83a54b2fSSadaf Ebrahimi priority CDATA #IMPLIED 116*83a54b2fSSadaf Ebrahimi> 117*83a54b2fSSadaf Ebrahimi<!ELEMENT script ANY> 118*83a54b2fSSadaf Ebrahimi<!ATTLIST script 119*83a54b2fSSadaf Ebrahimi language CDATA #REQUIRED 120*83a54b2fSSadaf Ebrahimi> 121*83a54b2fSSadaf Ebrahimi 122*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- 123*83a54b2fSSadaf EbrahimiA test contains parameters and classes. Additionally, you can define additional groups ("groups of groups") 124*83a54b2fSSadaf Ebrahimi--></span> 125*83a54b2fSSadaf Ebrahimi 126*83a54b2fSSadaf Ebrahimi<!ELEMENT test (method-selectors?,parameter*,groups?,packages?,classes?) > 127*83a54b2fSSadaf Ebrahimi 128*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- 129*83a54b2fSSadaf Ebrahimi@attr name The name of this test (as it will appear in the reports) 130*83a54b2fSSadaf Ebrahimi@attr junit Whether to run in JUnit mode. 131*83a54b2fSSadaf Ebrahimi@attr verbose How verbose the output on the console will be. 132*83a54b2fSSadaf Ebrahimi This setting has no impact on the HTML reports. 133*83a54b2fSSadaf Ebrahimi Default value: suite level verbose. 134*83a54b2fSSadaf Ebrahimi@attr parallel Whether TestNG should use different threads 135*83a54b2fSSadaf Ebrahimi to run your tests (might speed up the process) 136*83a54b2fSSadaf Ebrahimi@attr thread-count An integer giving the size of the thread pool to be used if 137*83a54b2fSSadaf Ebrahimi parallel mode is used. Overrides the suite level value. 138*83a54b2fSSadaf Ebrahimi@attr annotations If "javadoc", TestNG will look for 139*83a54b2fSSadaf Ebrahimi JavaDoc annotations in your sources, otherwise it will 140*83a54b2fSSadaf Ebrahimi use JDK5 annotations. 141*83a54b2fSSadaf Ebrahimi@attr time-out the time to wait in milliseconds before aborting 142*83a54b2fSSadaf Ebrahimi the method (if <span class="attribute">parallel="methods"</span> ) or the test (if <span class="attribute">parallel="tests"</span> ) 143*83a54b2fSSadaf Ebrahimi@attr enabled flag to enable/disable current test. Default value: true 144*83a54b2fSSadaf Ebrahimi@attr skipfailedinvocationCounts Whether to skip failed invocations. 145*83a54b2fSSadaf Ebrahimi--></span> 146*83a54b2fSSadaf Ebrahimi<!ATTLIST test 147*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED 148*83a54b2fSSadaf Ebrahimi junit (true | false) "false" 149*83a54b2fSSadaf Ebrahimi verbose CDATA #IMPLIED 150*83a54b2fSSadaf Ebrahimi parallel CDATA #IMPLIED 151*83a54b2fSSadaf Ebrahimi thread-count CDATA #IMPLIED 152*83a54b2fSSadaf Ebrahimi annotations CDATA #IMPLIED 153*83a54b2fSSadaf Ebrahimi time-out CDATA #IMPLIED 154*83a54b2fSSadaf Ebrahimi enabled CDATA #IMPLIED 155*83a54b2fSSadaf Ebrahimi skipfailedinvocationCounts (true | false) "false" 156*83a54b2fSSadaf Ebrahimi> 157*83a54b2fSSadaf Ebrahimi 158*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- 159*83a54b2fSSadaf EbrahimiDefines additional groups ("groups of groups") and also which groups to include in this test run 160*83a54b2fSSadaf Ebrahimi--></span> 161*83a54b2fSSadaf Ebrahimi<!ELEMENT groups (define*,run?) > 162*83a54b2fSSadaf Ebrahimi 163*83a54b2fSSadaf Ebrahimi<!ELEMENT define (include*)> 164*83a54b2fSSadaf Ebrahimi 165*83a54b2fSSadaf Ebrahimi<!ATTLIST define 166*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED> 167*83a54b2fSSadaf Ebrahimi 168*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- Defines which groups to include in the current group of groups --></span> 169*83a54b2fSSadaf Ebrahimi<!ELEMENT include ANY> 170*83a54b2fSSadaf Ebrahimi<!ATTLIST include 171*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED> 172*83a54b2fSSadaf Ebrahimi 173*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- Defines which groups to exclude from the current group of groups --></span> 174*83a54b2fSSadaf Ebrahimi<!ELEMENT exclude ANY> 175*83a54b2fSSadaf Ebrahimi<!ATTLIST exclude 176*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED> 177*83a54b2fSSadaf Ebrahimi 178*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- The subtag of groups used to define which groups should be run --></span> 179*83a54b2fSSadaf Ebrahimi<!ELEMENT run (include?,exclude?)* > 180*83a54b2fSSadaf Ebrahimi 181*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- The list of classes to include in this test --></span> 182*83a54b2fSSadaf Ebrahimi<!ELEMENT classes (class*) > 183*83a54b2fSSadaf Ebrahimi<!ELEMENT class (methods*) > 184*83a54b2fSSadaf Ebrahimi<!ATTLIST class 185*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED > 186*83a54b2fSSadaf Ebrahimi 187*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- The list of packages to include in this test --></span> 188*83a54b2fSSadaf Ebrahimi<!ELEMENT packages (package*) > 189*83a54b2fSSadaf Ebrahimi 190*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- The package description. 191*83a54b2fSSadaf Ebrahimi If the package name ends with .* then subpackages are included too. 192*83a54b2fSSadaf Ebrahimi--></span> 193*83a54b2fSSadaf Ebrahimi<!ELEMENT package (include?,exclude?)*> 194*83a54b2fSSadaf Ebrahimi<!ATTLIST package 195*83a54b2fSSadaf Ebrahimi name CDATA #REQUIRED > 196*83a54b2fSSadaf Ebrahimi 197*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- The list of methods to include/exclude from this test --></span> 198*83a54b2fSSadaf Ebrahimi<!ELEMENT methods (include?,exclude?)* > 199*83a54b2fSSadaf Ebrahimi 200*83a54b2fSSadaf Ebrahimi<span class="xml-comment"><!-- The list of listeners that will be passed to TestNG --></span> 201*83a54b2fSSadaf Ebrahimi<!ELEMENT listeners (listener*) > 202*83a54b2fSSadaf Ebrahimi 203*83a54b2fSSadaf Ebrahimi<!ELEMENT listener ANY> 204*83a54b2fSSadaf Ebrahimi<!ATTLIST listener 205*83a54b2fSSadaf Ebrahimi class-name CDATA #REQUIRED > 206*83a54b2fSSadaf Ebrahimi</pre> 207