The scenario is like i will fetch four data from open api end points from a json array for the first threenter code heree output. Then i kept the data in four arraylist, account no, com amount, revenue amount, mark up realized amount. Till this it works fine. Now i have to take the first index data from each of the list and use it in a test method. In this whay i would take the secound index, third indexx data from array list and use it in the sme test method. The test method will go the ui and vaidate. I have right now used a loop which executes this test method three times by taking data three times from the arraylist. Is there a different way where i can avoid the loop in test method and the test method will execute three times by taking the each index value from the arraylist.
@Test(dependsOnMethods = "getTransactionRecordDetailsForSpecificAccountNumberByDateRange")
public void verifyTransactionDetailsFromOpenAPIOnSFObject() throws InterruptedException, AWTException {enter code here
for (int i = 0; i < 3; i++) {
launchApp();
homepage = new HomePage();
companyaccountpage = new CompanyAccountPage();
homepage.navigateToCompanyAccountDetailsPage(li_AcctNo.get(i));
companyaccountpage.navigateToTransactionTableDetails();
Assert.assertEquals(companyaccountpage.getValueOfTotalComissionAmountFromTransactionTable(actual_tsDate),
li_comAmt.get(i));
Assert.assertEquals(companyaccountpage.getValueOfTotalMarkUpRealizedAmountTransactionTable(actual_tsDate),
li_markupAmt.get(i));
Assert.assertEquals(companyaccountpage.getValueOfTotalRevenueAmountFromTransactionTable(actual_tsDate),
li_revenueAmt.get(i));`enter code here`
fd.quit();