Although TestNG has a feature to run specific groups of tests using the groups
attribute, there may be cases where users will want to filter the data during extraction to include or exclude a subset of test data. The following filter code can be added to the DataProvider method (see the preceding placeholders).
There may be times when the user might want to run just a subset of the group of tests to create a "smokeTest" of some sort, narrowing the scope of the test run. Users can use TestNG groupings to assign tags to the test methods in the classes, and they can also filter in or filter out rows of data, using the DataProvider itself. This would allow them to select specific test rows of data or a small set with specific criteria like the rowID
in the JSON Data File.
When filtering with the DataProvider, users can set a TestNG parameter in the suite XML file, pull in the parameter as a system property, and parse in or out those rows...