Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Parameter annotation throws NullPointerException if dataset = null #823

Closed
irushah opened this issue Jun 17, 2016 · 1 comment
Closed

Parameter annotation throws NullPointerException if dataset = null #823

irushah opened this issue Jun 17, 2016 · 1 comment
Assignees
Labels

Comments

@irushah
Copy link

irushah commented Jun 17, 2016

Hi,

I have a negative test that takes in dataset with different values. Eg: null, empty string, invalid strings, etc. If i user @parameter annotation provided by allure, it throws Null pointer Exception
Here's the snippet of my test case and dataset

@Test(groups = TestGroups.Group1, dataProvider = "getInvalidCredentials")
    public void testInvalidLogin(@Parameter("username") String username,
            @Parameter("password") String password) {
        //do something with username and password
        }
    }
@DataProvider(name = "getInvalidCredentials")
    private Object[][] getInvalidCredentials() {
        return new Object[][] {
                                {null, null},
                                {"username", null}
               };
    }

Below is the stacktrace:

java.lang.NullPointerException at ru.yandex.qatools.allure.testng.AllureTestListener.fireAddParameterEvents(AllureTestListener.java:390)
    at ru.yandex.qatools.allure.testng.AllureTestListener.onTestStart(AllureTestListener.java:143)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1700)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1675)
@baev baev added the type:bug label Jun 21, 2016
@baev baev self-assigned this Jun 21, 2016
@baev
Copy link
Member

baev commented Jun 21, 2016

@irushah hi! Thanks for the report!

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

No branches or pull requests

3 participants