Advanced Features of TestNG with Selenium | TestNG Tutorial Part 2

Advanced Features of TestNG with Selenium | TestNG Tutorial Part 2 51 min

  

TestNG tutorial explains architecture of TestNG framework from scratch with real time examples for Annotations,Parameterization, @Dataprovider annotation and batch running test cases

QA Section

Speak Your Mind


Jenna

Hello can you please help When I create 3*3 array it still gives me Dataprovider mismatch error even though I passed 3 rows and 3 columns. I don't understand why . here is my code: package testcases; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class CreateUser { //step 2 - Linking Data provider @Test(dataProvider = "getData") public void createUser(String browser, String userType, int phone) // Step 3: number of input parameters same as no. of columns { } //step 1 @DataProvider public Object[][] getData() { Object[][] data = new Object [3][3]; //row 1 data[0][0]= "Chrome"; data[0][1]= "Admin"; data[0][2]= "4458"; //row 2 data[1][0]= "Mozilla"; data[1][1]= "superAdmin"; data[1][2]= "4433358"; //row 3 data[2][0]= "IE"; data[2][1]= "User"; data[2][2]= "3000"; return data; } }

Reply

Satish Wadde

I have one question : In console output why Listener SoP s like result.getName(),result.getStatus() etc are printed before the Test Case SoPs. Ideally we should have status of the TC after the TC execution. I even tried giving listener in testng.xml at the end but output remained same. Pls guide.

Reply