How to run a particular test in an test suite?



  • Iam new to selenium suite, please show me how to run an particular test in an test suite,

    Below is my test suite,

    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
    
    <suite name="TestAll">
    
    <test name="order">
        <classes>
            <class name="testSuite.TestConfig" />
            <class name="testSuite.TestOrder" />
        </classes>
    </test>
    
    <test name="database">  
        <classes>
            <class name="testSuite.TestConfig" />
            <class name="testSuite.TestDatabase" />
        </classes>
    </test>
    </suite>
    

    I wanted to run the test that has name "database", but without deleting the test that has name "order", so is there any way to do it? please throw me the light.



  • There are two ways of proceeding with this.

    1. Go to the actual class file testSuite.TestOrder and change the @Test tag on the method to @Analeea But you will have to recompile your class files every time you have to make a change.

    2. @Test(group={"ignore"}) TestNG has a group option which help you categorize the tests. Mark all test that you want to ignore during the run in the above format. Now modify the testng.xml

    Use this and experiment around. http://www.tutorialspoint.com/testng/testng_tutorial.pdf



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2