Forum Discussion

rodanger's avatar
rodanger
New Contributor
2 months ago

NUnit test fails to run in TestComplete

I have a Visual Studio NUnit C# Selenium test project which runs tests fine. I can also run these tests from the nunit-console.exe test runner: nunit3-console.exe testcore.dll --where "namespace == 'CreditTests'". I have configured TestComplete to run this NUnit test but when I press Run, it does not run the test and ends in 1 second with an empty result.

Is there a TestComplete log that I can inspect to figure what error occurred?

5 Replies

    • rodanger's avatar
      rodanger
      New Contributor

      Yes I have. TestComplete does not give any details on what is going wrong.

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        The documentation gives details on how to correctly set it up.

  • Yes, TestComplete does generate a log that can help you diagnose what happened during a test run.

    This log should include command-line output from any unit testing framework (like NUnit), along with errors or messages if something went wrong. If the log appears empty, it typically means no tests were discovered or executed.

    • If you're using the TestComplete IDE, you can view the log directly within the interface. More details are available here  Test Log Overview โ€“ TestComplete Documentation
    • If you're running tests via the command line and did not explicitly set a log export path, the logs are saved by default in <ProjectSuiteFolder>\Log\<LastTestRun>

    You can also use the /ExportLog switch to export the log to a specific location or format.

    ๐Ÿค– AI-assisted response
    ๐Ÿ‘ Found it helpful? Click Like
    โœ… Issue resolved? Click Mark as Solution

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    After reading through https://support.smartbear.com/testcomplete/docs/testing-with/advanced/unit-testing/net-applications.html I've created a simple C# .NET 4.8 application with some basic unit tests, which has been picked up by TCUnitTest, shown below,

    Unit tests within my application

    When I run the following code, to execute all unit tests,

    UnitTesting["TCUnitTest"]["Execute"](); 

    all tests are executed, and the last test displays a message box,

    Message box shown when test TestMsgBox is called

    I couldn't get .NET 8.0 to work, and I'm not sure if it's supported.