samedi 3 décembre 2016

Optimized Way for Data Parameterization in TestNG

I am trying to create a framework using selenium and TestNG. As a part of the framework i am trying to implement Data Parameterization. But i am confused about optimized way of implementing Data parameterization. Here is the following approaches i made.

  1. With Data Providers (from excel i am reading and storing in object[][])
  2. With testng.xml

Issues with Data Providers:

  1. Lets say if my Test needs to handle large volumes of data , say 15 different data, then i need to pass 15 parameters to it. Alternative , if i try to create a class TestData to handle this parameters and maintain in it , then for every Test there will be different data sets. so my TestData class will be filled with more than 40 different params.

Eg: In a Ecom Web site , There will be many different params exists like for Accounts , cards , Products , Rewards , History , store Locations etc., for this we may need atleast 40 different params need to declared in Test Data.Which i am thinking not a suggestable solution. Some other tests may need sometimes 10 different test data, some may need 12 . Even some times in a single test one iteration i need only 7 params in other iteration i need 12 params .

How do i manage it effectively?

Issues with Testng.xml

Maintaining 20 different accounts , 40 different product details , cards , history all in a single xml file and configuring test suite like parallel execution , configuring only particular classes to execute etc., all together will mess the testng.xml file

So can you please suggest which is a optimized way to handle data in Testing Framework . How in real time the data parameterization , iterations with different test datas will be handled

Aucun commentaire:

Enregistrer un commentaire