Код: Выделить всё
pulbic class DataProiders {
@DataProvider(name="data")
public String[][] getAllData() throws IOException {
// Using XLUtils class which uses XSSWorkbook to get cell data
//Take the name of the xls file and sheet name and calculate row and column count
//two for loops rowcount and columncount to get all data and return the data
}
//I have the test clsss test.java
public class CutomerRecords {
pulbic Response response;
public static JSONObject resJsonObj;
@Test(priority = 1, dataProvider = "data", dataProviderClass = DataProviders.class)
public void CustomerData(String cId, String fName, String lName, String email, String postCode){
//These are the 5 columns in the xls sheet
//set method to set all the parameters using pojo class for request
//Call the POST API and get the response back
response = PostMehtodFromAPIClass(request)
resJsonOj= new JSONObject(response.getBody().asString());
}
@Test(priority=2)
public void validateResponseCusID(){
//my validation logic using resJsonObj
}
@Test(priority=2)
public void validateResponseCusName(){
//my validation logic using resJsonObj
}
@Test(priority=2)
public void validateResponseCusPostCode(){
//my validation logic using resJsonObj
}
@Test(priority=2)
public void validateResponseCusEmail(){
//my validation logic using resJsonObj
}
/>Но происходит следующее: если у меня есть 5 строк в xls, он выполняет 5 строк, и только для последней строки работают функции ответа проверки. Мне нужно предложение читать одну строку за раз и вызывать функции проверки, затем вторую строку и проверки и так далее.
Подробнее здесь: https://stackoverflow.com/questions/784 ... row-in-xls
Мобильная версия