How to call test methods from main class if test methods are using Dataprovider annotation?

I have to create test scripts for an android application. I have a two JSON files, fileA has test cases with value true or false and fileB has multiple test data for each test case.
Inside main class, I read fileA and if value of test case is true, I have to execute respective test case. So basically test methods are being called from main class.

But the issue is that test methods are using dataprovider annotation to get test data from JSON file. Now if I have to call test methods from main method, I will have to pass the data as parameters. So test method will be executed only once while I have to execute it for all the positive and negative  test data.

I have one solution in my mind which is remove annotation,  read data from JSON file, find the number of test data and call test method inside a loop.

Any other suggestions?

Default Asked on November 25, 2016 in Appium.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.