Hi All,
I am getting an error 'SetUp failed for test fixture' while building the code. Database is unable to set connection with Database. Whilst debugging I found that it throws this error while building session factory.
But if I run the same code in other's system then it is working fine. I am not able to fine the root-cause as why it is not working on my system.
Please suggest how to resolve this error.
[05/04/2019 14:00:26 Informational] ------ Discover test started ------
[05/04/2019 14:00:29 Informational] NUnit VS Adapter 2.0.0.0 discovering tests is started
[05/04/2019 14:00:33 Informational] NUnit VS Adapter 2.0.0.0 discovering test is finished
[05/04/2019 14:00:34 Informational] NUnit VS Adapter 2.0.0.0 discovering tests is started
[05/04/2019 14:00:35 Informational] NUnit VS Adapter 2.0.0.0 discovering test is finished
[05/04/2019 14:00:35 Informational] ========== Discover test finished: 622 found (0:00:08.8636389) ==========
[05/04/2019 14:00:49 Informational] ------ Run test started ------
[05/04/2019 14:00:49 Informational] NUnit VS Adapter 2.0.0.0 executing tests is started
[05/04/2019 14:00:50 Informational] Loading tests from D:\Users\IntegrationTest.dll
[05/04/2019 14:00:50 Informational] Run started: D:\Users\IntegrationTest.dll
[05/04/2019 14:00:53 Error] SetUp failed for test fixture IntegrationTest.Specflow.Features.Test1
[05/04/2019 14:00:53 Error] SetUp : System.NullReferenceException : Object reference not set to an instance of an object.
[05/04/2019 14:00:53 Error] at IntegrationTest.DataBase.NHibernate.SessionHelper.CloseSession(ISession session) in D:\Users\IntegrationTest\DataBase\NHibernate\SessionHelper.cs:line 65
at IntegrationTest.DataBase.NHibernate.TransactionHelper.RunTransaction(String sqlQuery) in D:\Users\IntegrationTest\DataBase\NHibernate\TransactionHelper.cs:line 100
at IntegrationTest.Specflow.Base.ScenarioBase.CreateProcedure() in D:\Users\IntegrationTest\Specflow\Base\ScenarioBase.cs:line 128
at IntegrationTest.Specflow.Base.ScenarioBase.BeforeTestRun() in D:\Users\IntegrationTest\Specflow\Base\ScenarioBase.cs:line 89
at lambda_method(Closure , IContextManager )
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType bindingEvent)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnTestRunStart()
at TechTalk.SpecFlow.TestRunner.OnTestRunStart()
at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner)
at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId)
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Int32 threadId)
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Nullable`1 managedThreadId)
at IntegrationTest.Specflow.Features.Test1.FeatureSetup()
[05/04/2019 14:00:53 Informational] NUnit VS Adapter 2.0.0.0 executing tests is finished
[05/04/2019 14:00:54 Informational] ========== Run test finished: 1 run (0:00:04.9835641) ==========