QMetry Automation Studio Data Driven Approach

To make any test data driven,user can use QAFDataProvider annotation on test method , where test cases are executed for each data set provided in external data file. QMetry Automation Studio supports following file formats to provide data for data driven tests.

  • CSV
  • JSON
  • XML

For Example

As shown below with QAFDataProvider annotation User can provide file name in dataFile parameter and other required values in their related parameters for associated file format.

        @QAFDataProvider(dataFile = "resources/searchdata.csv") 
	@QAFDataProvider(dataFile = "resources/searchdata.json") 
	@QAFDataProvider(dataFile = "resources/searchdata.xls") 
	@QAFDataProvider(dataFile = "resources/data/searchdata.xls", sheetName="sheet2") 
	@QAFDataProvider(key="") //xml key no need to provide file name 
	@QAFDataProvider(sqlQuery = "select col1, col2 from tbl")  

Here is the example how you can make your test data driven with csv file.


@QAFDataProvider(dataFile = "resources/searchdata.csv")
    @Test(groups = { "SMOKE", "P1" }, description = "Search using keyword")
    public void searchWithDifferentKeyword(Map<String, String> map) {
        sendKeys(map.get("keyword"), "");


SCENARIO: Search with different keyword
META-DATA: {"description":"Search using different keyword","groups":["SMOKE", "P1"], "dataFile":"resources/searchdata.csv" }

Given get ''
    Then assert '' is present
    When sendKeys '${keyword}' into ''
    And submit ''
    Then assert link with partial text '${link-text}' is present

Another Example:
@QAFDataProvider(dataFile = "resources/logindata.csv")
@Test(description = "login validation message " , groups={"p1" , "p2"})
public void login(Map <String, String> data) {
	assertLoginMsg(data.get("expectedMsg")) }

Generated Report after Test Execution.

For more details you can click on below link.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Article is closed for comments.
Powered by Zendesk