3

I am learning selenium. I am trying to get into more and more automation.

Scenario (example): We are working in the agile. 2 weeks of sprint. We have a release after every 3 sprint. In our framework we have used hybrid approach (combination of data driven and POM). Every test class having 40 test cases and we have 20 test class, in total of 3 sprint there are 800 test cases out of which we need to select 500 test cases for regression.

Question: which method we should use

1: using testNG annotation groupBy to give a name as a regression and then create a testng.XML file (or regression.XML) and pass with the group. If yes then how to declare in our XML file?

2: is there any better approach?

0

Here is the Sample XML file code

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Sample Suite">
  <test name="testing">
    <groups>
      <run>
        <include name="Regression"/>
      </run>
    </groups>
    <classes>
       <class name="com.example.group.groupExamples" />
    </classes>
  </test>
</suite>

For more details checkout TestNG groups

0

You can declare the groups as

<groups>
<run>
<include name="group1"></include>
<include name="group2"></include>
</run>
</groups>

Then in the class file declare as

<classes>
<class name="packagename.ClassName"/> 
<class name="packagename.ClassName" />
</classes>

If you are passing any parameters then declare as

<parameter name="browser" value="chrome"></parameter>
<parameter name="url" value="https://localhost"></parameter>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.