5

I am using QAF for my automation project. I have project specific meta-data which has group SMOKE, regression, P1 and author with x,y,z name.

SCENARIO: SampleTest
META-DATA: {"description":"Sample Test Scenario","groups":["SMOKE"],"author":["x"]}

    #TODO: call test steps
END

I want to run only "smoke" group and author with "x" or "y". Is there any solution for these?

Developer
  • 1,009
  • 8
  • 25
  • 56
bangoria anjali
  • 400
  • 1
  • 10

2 Answers2

1

You can use include or exclude properties refer documentation here. For example:

include= {'author': ['x']}

to run all scenario with author value x. you can provide this properties in any property file or as system property or in run configuration xml file refer different ways of providing prop.

user861594
  • 5,733
  • 3
  • 29
  • 45
1

For example,

 public class TestSelenium {

    @Test(groups= "SMOKE")
    public void runSelenium() {
        System.out.println("runSelenium()");
    }

    @Test(groups= "Regression")
    public void runSelenium1() {
        System.out.println("runSelenium()1");
    }
}

Now if you want to execute only "SMOKE" group, do like this way.

<suite name="TestAll">
<!-- Run test method on group "selenium" only -->
<test name="selenium">

    <groups>
        <run>
            <include name="SMOKE" />
        </run>
    </groups>

     <classes>
        <class name="com.TestSelenium" />
     </classes>

   </test>

</suite>

For more details, inclusion/exclusion refer this. http://testng.org/doc/documentation-main.html#exclusions.