TestNg.xml explained

TestNg.xml explained

The TestNg.xml file is a is a configuration file that is used by the TestNG framework to define, pass parameters to test methods and run tests that are defined in test suites inside the xml file.
TestNg gives us the option to include packages, classes or individual test methods in the test suite defined.

Let`s see how is created and how can we use the TestNG.xml
Go to your project folder in your IDE , right click and choose New File

Name the file testNg.xml and press Finish

You will now see a new file called testNg.xml in your project folder.

Put the following code snipped into the file :

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="My Suite" verbose="1" > 
   <test name="First Test" >
      <classes>
         <class name="test.testExample" />
      </classes>
   </test>
</suite>

Please note that test from test.testExample is the package name and the testExample is the class name.
You can change them to match your package name and test class name.

What we have in this xml now is a suite defined.
The suite is defined uisng the ‘suite’ tag and it is named “My Suite”

<suite name="My Suite" verbose="1" > 

Then we have the ‘test’ tag. Please note that this is the tag that i mentioned on when we spoked about the BeforeTest/AfterTest annotation.
The name of the test is given by the ‘name’ attribute and in our case is “First Tests”

<test name="First Test" >

Next we have the ‘class’ tag which contains the class that we want to run. The format is in which is written is ‘packageName.className’ in our example ‘test.testExample’

     <class name="test.testExample" />

Now let`s see how we can run it. We have the option tu run it either via terminal or by using the IDE (Eclipse in our case)

To run it from IDE, you will have to right-click the file in the project folder and select Run As -TestNg suite

Now, after we run it, you will notice a new folder appears in your project folder. This folder is named ‘test-output’ and it contains a HTML report of your run.

If you expand this folder you will find the HTML report as a file called “index.html”

Opening this file you will see the report of your run.

154 comments

  1. Pingback: buy generic cialis online

  2. Pingback: zoloft erectile dysfunction

  3. Pingback: metronidazole milk

  4. Pingback: how quickly does cymbalta work

  5. Pingback: lexapro and seroquel

  6. Pingback: price of escitalopram 20 mg

  7. Pingback: does keflex treat strep throat

  8. Pingback: how long is fluoxetine in your system

  9. Pingback: sildenafil in india online

  10. Pingback: cephalexin vs cefazolin

  11. Pingback: gabapentin klonopin

  12. Pingback: duloxetine hcl 20mg ec cap

  13. Pingback: ciprofloxacin 500mg tablets

  14. Pingback: is cephalexin the same as amoxicillin

  15. Pingback: bactrim for dogs

  16. Pingback: bactrim dosage 800/160 for uti

  17. Pingback: can i drink alcohol with amoxicillin

  18. Pingback: cost of neurontin without insurance

  19. Pingback: flexeril dosing

  20. Pingback: flomax for women with kidney stones

  21. Pingback: rybelsus vs contrave

  22. Pingback: diclofenac over the counter

  23. Pingback: antibiotic augmentin

  24. Pingback: diltiazem hcl side effects

  25. Pingback: how long does it take for effexor to work

  26. Pingback: ezetimibe epocrates

  27. Pingback: citalopram indications

  28. Pingback: hyzaar vs cozaar

  29. Pingback: ddavp for incontinence

  30. Pingback: depakote vs lithium

  31. Pingback: amitriptyline hcl 10 mg

  32. Pingback: aripiprazole other names

  33. Pingback: allopurinol dose

  34. Pingback: 325 mg aspirin

  35. Pingback: buspar for depression

  36. Pingback: how long does it take for celebrex to start working

  37. Pingback: bupropion xl weight loss reviews

  38. Pingback: ashwagandha when to take

  39. Pingback: what is baclofen used for

  40. Pingback: augmentin medscape

  41. Pingback: switching from celexa to lexapro

  42. Pingback: pms-repaglinide 2mg

  43. Pingback: semaglutide cost

  44. Pingback: remeron for elderly

  45. Pingback: actos escolares.com

  46. Pingback: side effects of protonix

  47. Pingback: robaxin methocarbamol

  48. Pingback: acarbose china

  49. Pingback: is abilify safe during pregnancy

  50. Pingback: is tizanidine a benzo

  51. Pingback: venlafaxine immediate release vs extended release

  52. Pingback: prescription free voltaren gel

  53. Pingback: tamsulosin empty stomach

  54. Pingback: ivermectin oral

  55. Pingback: sitagliptin side effects pancreatitis

  56. Pingback: spironolactone zonder recept kopen

  57. Pingback: synthroid sulfa

  58. Pingback: vardenafil vs tadalafil vs sildenafil

  59. Pingback: cialis online pills

  60. Pingback: levitra order online

  61. Pingback: percocet in mexican pharmacy

  62. Pingback: pharmacy customer care cialis

  63. Pingback: where to buy levitra online no prescription

  64. Pingback: cialis tadalafil 20 mg bula

  65. Pingback: sildenafil and tadalafil

  66. Pingback: ivermectin oral 0 8

  67. Pingback: stromectol pills

  68. Pingback: generic viagra canada pharmacy

  69. Pingback: vardenafil dosis

  70. Pingback: cost of ivermectin 3mg tablets

  71. Pingback: buy sildenafil 200mg

  72. Pingback: stromectol ivermectin 3 mg

  73. Pingback: vardenafil tablets 20 mg

  74. Pingback: tadalafil dosage for ed

  75. Pingback: what is tadalafil 20 mg

  76. Pingback: ivermectin 0.5

  77. Pingback: ivermectin 15 mg

  78. Pingback: doxycycline monohydrate 100 mg tablet

  79. Pingback: cephalexin sinus infection

  80. Pingback: maximum dose of gabapentin in 24 hours

  81. Pingback: ampicillin brands in india

  82. Pingback: does metformin cause weight loss

  83. Pingback: lisinopril used for

  84. Pingback: amoxicillin 500mg dosage

  85. Pingback: what are the side effects of trazodone

  86. Pingback: what not to take with lyrica

  87. Pingback: is provigil habit forming

  88. Pingback: ciprofloxacin hydrochloride ophthalmic solution

  89. Pingback: does valacyclovir work for cold sores

  90. Pingback: cipro vs keflex

  91. Pingback: vardenafil 40 mg tablets

  92. Pingback: percocet pharmacy

  93. Pingback: buy usa generic levitra pills

  94. Pingback: does viagra make you bigger

  95. Pingback: how long does it take for tadalafil to work

  96. Pingback: sildenafil with alcohol reddit

  97. Pingback: blue chew sildenafil

  98. Pingback: sildenafil 100mg review

  99. Pingback: sildenafil daily dosage

  100. Pingback: sertraline and sildenafil together reddit

  101. Pingback: fda approved online pharmacy

  102. Pingback: buy levitra online cheap

  103. Pingback: is cialis a controlled substance

  104. Pingback: is cialis the same as tadalafil

  105. Pingback: how to take levitra

  106. Pingback: generic levitra 20mg

  107. Pingback: cheapest pharmacy viagra

  108. Pingback: sildenafil last longer

  109. Pingback: 10mg levitra buy

  110. Pingback: tadalafil duration

  111. Pingback: online pharmacy no prescription ultram

  112. Pingback: online pharmacy coupon

  113. Pingback: sildenafil controlled substance

  114. Pingback: new at your publix pharmacy free lisinopril

  115. Pingback: what is the difference between cialis and viagra

  116. Pingback: levitra vardenafil 10mg

  117. Pingback: sildenafil side effects blood pressure

  118. Pingback: how long does tadalafil 10mg last

  119. Pingback: pharmacy that sells rohypnol

  120. Pingback: how long does it take for tadalafil to take effect

  121. Pingback: simvastatin kroger pharmacy

  122. Pingback: buy online pharmacy uk

  123. Pingback: tadalafil lower blood pressure

  124. Pingback: vardenafil 20

  125. Pingback: 10 mg tadalafil

  126. Pingback: tadalafil drug class

  127. Pingback: phentermine pharmacy biz

  128. Pingback: my 24 hour pharmacy online

  129. Pingback: etodolac is used for

  130. Pingback: normal dosage of gabapentin for nerve pain

  131. Pingback: sulfasalazine side effects heartbeat

  132. Pingback: medicamento motrin retard

  133. Pingback: tegretol l.p 400 mg

  134. Pingback: celecoxib long term

  135. Pingback: ibuprofen tegen hoest

  136. Pingback: phentermine gabapentin

  137. Pingback: cymbalta vs celebrex

  138. Pingback: carbamazepine nausea

  139. Pingback: elavil for migraines dosage

  140. Pingback: uc flare on imuran

  141. Pingback: mobic psychiatric side effects

  142. Pingback: piroxicam durante el embarazo

  143. Pingback: baclofen rezeptfrei preisvergleich

  144. Pingback: sumatriptan ulcerative colitis

  145. Pingback: azathioprine taken with prednisone

  146. Pingback: what are the side effects of taking meloxicam

  147. Pingback: maxalt coupon card

  148. Pingback: get toradol no prescription

  149. Pingback: st.pauls artane fc

  150. Pingback: periactin fda

  151. Pingback: can i buy ketorolac without insurance

  152. Pingback: cyproheptadine hydrochloride with tricholine citrate syrup uses

  153. Pingback: what is tizanidine medicine

  154. Pingback: how much does zanaflex sell for on the street

Comments are closed.