Sitelet https://web.archive.org/web/20210117055002/https://github.com/paypal/SeLion/issues/378
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

NullPointerException with SelionAssert.assertXXX in DataProvider #378

sbheemanadham opened this issue Jan 19, 2018 · 1 comment

Comments

@sbheemanadham
Copy link

@sbheemanadham sbheemanadham commented Jan 19, 2018

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 mach6 added this to the 2.0.0 milestone Jan 19, 2018
@mach6
Copy link
Contributor

@mach6 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.