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

Parameter annotation throws NullPointerException if dataset = null #823

@irushah

Description

@irushah

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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions