Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with SelionAssert.assertXXX in DataProvider #378

Open
sbheemanadham opened this issue Jan 19, 2018 · 1 comment
Open

Comments

@sbheemanadham
Copy link

SeLion Version : 1.2.0

Component : SeLion

Expected Behavior : Hard asserts should work from the DataProvider

Actual Behavior : NullPointerException when hard assert is in DataProvider

Caused by: java.lang.NullPointerException
at com.paypal.selion.platform.asserts.SeLionHardAssert.showAssertInfo(SeLionHardAssert.java:38)
at com.paypal.selion.platform.asserts.SeLionHardAssert.onAssertSuccess(SeLionHardAssert.java:29)
at org.testng.asserts.Assertion.doAssert(Assertion.java:16)
at org.testng.asserts.Assertion.assertTrue(Assertion.java:109)
at com.paypal.selion.platform.asserts.SeLionAsserts.assertTrue(SeLionAsserts.java:384)

Steps to Reproduce:

@dataProvider(name = "dp1", parallel = true)
public static Object[][] dp1() throws Exception {

    String fileName = "DPFile.xlsx";

    SeLionAsserts.assertTrue(!StringUtils.isEmpty(fileName), "Found the spreadsheet");

    DataResource resource = new FileSystemResource(fileName, DPFilePojo.class);
    SeLionDataProvider dataProvider = DataProviderFactory.getDataProvider(resource);
    return dataProvider.getAllData();

}
@mach6
Copy link
Contributor

mach6 commented Jan 19, 2018

Root Cause: There is no @Test method information available in this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants