Search code examples
c#mstestspecflowlambdatest

Command logs in Lambdatest disappear after test finishes


I have UI based tests written using Specflow & MSTest. Recently I needed to migrate my tests from NUnit to MSTest. After this migration I noticed that when test is running I can see command logs, but after test finishes I have this information: "No command logs generated". I tried to comment out the driver.Quit() as I thought this might be related to incorrect driver closure, however this didn't changed anything. Additionally I added log4net, but also when I disable this feature, still command log in lambdatest is cleared out. Also I tried to check with older browser version (102.0 instead of 103.0) but without success, still no command logs preserved. I am wondering if anyone had similar issue?

My capabilities options:

    GetUserCredentialsFromJson();
    var options = GetRemoteBrowserOptions(browserName);
    options!.BrowserVersion = ConfigurationDetails.BrowserVersion!;
    Dictionary<string, object> lambdaTestOptions = new()
    {
        { "user", lambdaTestUserName }, { "accessKey", lambdaTestAppKey },
        { "build", ConfigurationDetails.Build },
        { "name", testContext.TestName },
        { "platformName", ConfigurationDetails.OS },
        { "resolution", ConfigurationDetails.Resolution},
        { "network", true },
        { "console", true },
        { "video",  true },
        { "terminal", true }
    };
    options.AddAdditionalOption("LT:Options", lambdaTestOptions);
    try
    {
        driver = new RemoteWebDriver(
            new Uri(
                $"https://{lambdaTestUserName}:{lambdaTestAppKey}@hub.lambdatest.com/wd/hub"),
            options.ToCapabilities());
    }
    catch (Exception e)
    {
        Logger.Error($"There was an exception with connection to lambda test: {e}");
    }

Solution

  • It appears that screenshots that were made during test run exceeded the maximum heap size. Commenting out screenshot function allowed me to see logs again. Still need to find a way to overcome this, but at least I found the root cause.