Archive For The “TestNG” Category

Run TestNG class in main method

By |

public static void main(String[] args) { TestListenerAdapter testListenerAdapter = new TestListenerAdapter(); TestNG testng = new TestNG(); testng.setTestClasses(new Class[] { test.class }); testng.addListener(testListenerAdapter); testng.run(); }

Read more »

Using dataprovider in TestNG

By |

package com.automation; import …;   @Listeners({com.automation.listenner.Local.class}) public class testClass{ AppiumDriver driver = null; @BeforeMethod public void beforeMethod() { } @DataProvider public Object[][] inputDatas() { Object[][] inputDatas = null; String csvFile = “C:” + File.separator + “file.csv”; try { List<String> lines = Files.readAllLines(new File(csvFile).toPath()); inputDatas = new Object[lines.size()][10]; String[] datas = new String[10]; String line =…

Read more »

Using listener in TestNG class

By |

import com.automation.Example; @Listeners({com.automation.listenner.LocalSuiteListener.class, com.automation.listenner.LocalReportListener.class}) public class testClass{

Read more »