java - How can we create dependency on several tests in testNg suite.xml -


I am a novice for testNG and have created a suite.xml below:

  Lt; DOCTYPE Suite System "http://testng.org/testng-1.0.dtd" & gt; & Lt; Suite name = "test" verbose = "0" allow-return-value = "true" & gt; & Lt; Test name = "test1" preserve-order = "true" & gt; & Lt; Classes & gt; & Lt; Class name = "tests.checkLogin" /> & Lt; / Sections & gt; & Lt; / Test & gt; & Lt; Test name = "test2" preserve-order = "true" & gt; & Lt; Classes & gt; & Lt; Class name = "tests.fetchFromDB" /> & Lt; / Sections & gt; & Lt; / Test & gt; & Lt; / Suits & gt;   

All tests are written in Java and here, log in and classes are available in the FEMDB check package.Now, my test 1 has failed due to some issue and I fail it For obviously throwing out the runtime exception, this test successfully failed. However, after this test2 is successfully called, my requirement is that if test1 fails then test2 should not be applied. Can anyone help me how can this be achieved?

Name test1 is basically a setup step). I somehow feel that your test design is wrong for your problem, if you want to control it with your XML, then you can use the group concept and make dependency in XML - < / Div>

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -