Forum Discussion

VinnyK's avatar
Occasional Contributor
5 years ago

Unable to find Test Logs, not sure if they are being logged



I am using SpecFlow and Nunit 3 with NUnit3Adaptor.


Within my test steps I am logging some test messages and capturing screenthot but I can't find anything in the bin folder nor in the Project directory. I don't even see TestResults folder.



IDriver Driver = new LocalDriver();
Driver.Log.Message("Application Launched");
Driver.Log.Screenshot(test.controlGrid, "Screenhot of a Grid table");
Driver.Log.Message("Test Again");
Assert.Fail();// force failing in case the logs are being cleared


Am I missing something here ? Can anyone please help me how to use the TestLeft's capturing Test Log and screenshot funtionality?

Thanks in advance



3 Replies

    • VinnyK's avatar
      Occasional Contributor

      Thanks Alex, 


      I know whats happening, when we add a TestLeft to our project it creates TestFixtureBase with NUnit hook attributes ([OneTimeSetUp], [OneTimeTearDown] ..etc) methods


      public void InitializeFixture()

      public void FinalizeFixture()
      _driver.Log.Save(TestContext.CurrentContext.TestDirectory + @"\TestResults", Log.Format.Html);

      public void TestSetUp()



      When running the NUnit tests, the logging and saving logs, works fine. But when we add SpecFlow on top of this, then these methods with NUnit hook attribute won't get run as SpecFlow has its own hook attributes [BeforeScenario], [BeforeTestRun], [AfterScenario]... etc.


      So we would need to replace [OneTimeSetUp] to [BeforeTestRun] and [OneTimeTearDown] to [AfterTestRun] and make the binding methods static and add "[Binding]" on top of the class signature

      • AlexKaras's avatar
        Champion Level 3

        VinnyK :



        Thank you for the detailed description. Hope it will help someone else who will use the configuration like yours.