baseclass / Contrib.SpecFlow.Selenium.NUnit

Test class generator to drive automated web ui tests with Selenium and SpecFlow
http://www.nuget.org/packages/Baseclass.Contrib.SpecFlow.Selenium.NUnit/
22 stars 13 forks source link

NullReferenceException when running tests #5

Closed vtortola closed 10 years ago

vtortola commented 10 years ago

Hi,

Everytime I try to run a test, I get a null reference exception:

TestApplication.UiTests.CalculatorFeatureFeature.AddTwoNumbers:
System.NullReferenceException : Object reference not set to an instance of an object.

This is happening even in the examples provided in GitHub. What I did:

TestApplication.UiTests.CalculatorFeatureFeature.AddTwoNumbers:
System.NullReferenceException : Object reference not set to an instance of an object.
TestApplication.UiTests.CalculatorFeatureFeature.AddTwoNumbers:
System.NullReferenceException : Object reference not set to an instance of an object.
TestApplication.UiTests.CalculatorFeatureFeature.AddTwoNumbers:
System.NullReferenceException : Object reference not set to an instance of an object.
TestApplication.UiTests.CalculatorFeatureFeature.AddTwoNumbers:
System.NullReferenceException : Object reference not set to an instance of an object.
TestApplication.UiTests.CalculatorFeatureFeature.BasepageIsCalculator:
System.NullReferenceException : Object reference not set to an instance of an object.
TestApplication.UiTests.CalculatorFeatureFeature.BasepageIsCalculator:
System.NullReferenceException : Object reference not set to an instance of an object.
TestApplication.UiTests.CalculatorFeatureFeature.BasepageIsCalculator:
System.NullReferenceException : Object reference not set to an instance of an object.

The exception details shows:

at NUnit.Core.Extensibility.ParameterSet.FromDataSource(Object source)
at NUnit.Core.Builders.TestCaseParameterProvider.GetTestCasesFor(MethodInfo method)

I am using:

I have tried in .NET 4.0 and Visual Studio 2010 with libraries compiled for that version, and got the same issue.

Any idea what could be the problem?

romerod commented 10 years ago

What version of nunit are you using?

vtortola commented 10 years ago

Right on the spot. Apparently there is two nUnit versions installed, one for 2.0 and other for the rest.

I works great, nice job.