Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TestNG - Test ignored error message

Tags:

testng

Execution is stopped after @BeforeSuite before @BeforeMethod would be executed. I use (alwaysRun=true) in each cases. It doesn't execute another test cases from suite. I got error message:

Test ignored.

@BeforeMethod(alwaysRun=true)
public void launchBrowser() throws Exception
{
    browser = BrowserFactory.launch(BrowserType.CHROME);
    logger.info("Browser Launched");
}

@AfterMethod(alwaysRun=true)
public void closeBrowser() throws Exception
{
    browser.close();
}

@AfterSuite(alwaysRun=true)
public static void tearDown() throws Exception
{
    Reporter.generateReport();
    SDK.cleanup();
}
like image 672
plaidshirt Avatar asked Oct 18 '25 04:10

plaidshirt


2 Answers

Here, it looks like the case is mostly because of DataProvider. If you are using DataProvider and haven't set it up properly (like not returning proper 2D array, returning empty array etc) it will ignore the test method. So make sure your DataProvider is proper and run the test again.

like image 197
Praseeth S Avatar answered Oct 21 '25 11:10

Praseeth S


I have faced the similar issue , and thought its a compiler issue/ Testng Issue. But there was a problem in the way I was using dataprovider . Better put a debugger pointer in DataProvider function and debug you would be able to find the issue.

Env : Java + SDK + IntelliJ

like image 20
Bala Krishnan Avatar answered Oct 21 '25 10:10

Bala Krishnan