Forum Discussion

Jacobjacob44's avatar
Jacobjacob44
Occasional Contributor
4 months ago

Log.SaveResultsAs() Unable to export the summary

Hi,

I've been using the Log.SaveResultsAs() method to assist in creating summary htm files to be emailed out showing if our scheduled test runs have passed / failed. I've had no issue previously doing so, the tests had been running for several weeks with no issue until today. 

My project creates a new folder for logs to be stored in, runs any scripts as desired, then saves the results (Using Log.SaveResultsAs()) into the created folder, then emails out a summary report of the scheduled run test summary. 

When I run my scripts now, when the Log.SaveResultsAs() code is hit (I did code stepthrough to check this is the point the error is triggered), I get the below error.

Nothing has changed in my environment setup - the only difference is today we updated TestComplete to the latest version. I did some snooping on the TC Documentation to check if the method has changed, but as far as I saw it shouldn't be any different?
Despite what the error above states, files are created when the Log.SaveResultsAs() code is hit, and the subsequent code I have does allow the email to be sent with a summary.htm attachement, but the TestComplete error is causing my tests to freeze until the error is dealt with. 

Below is the code I am using (Using Python!) - I would normally have the following as my execution plan -
Create New Log folder
My project test scripts
Save results and then email summary

Below is the Create New Log folder code

Below is the Save results and email summary code (Some details are censored for obvious reasons)

Any advice on how to resolve this would be much appreciated.

Jacob.

  • Yes, I tried the sample code you provided and encountered the same error.

    I was working on the latest version of TC (15.62), I have since rolled back to version 15.60 and the error no longer occurs. It would seem it's a bug with that version of TC. 

    Thank you for trying to assist. 

10 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Create a new project, to send a simple email (or file) via your smtp server. Does it work?

    What smtp server are you using?

    • Jacobjacob44's avatar
      Jacobjacob44
      Occasional Contributor

      Hi,

      As mentioned above, the email is still being sent in my current project - that isn't the issue.

      Despite what the error above states, files are created when the Log.SaveResultsAs() code is hit, and the subsequent code I have does allow the email to be sent with a summary.htm attachement, but the TestComplete error is causing my tests to freeze until the error is dealt with.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Do what rraghvani suggested, except with the log results. Create a small test that just does something small and then do the Log.SaveResultsAs(). We want to isolate the code that is failing.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Emailing is not the issue then? Again, create a new project and run this simple (JavaScript) function

    function Test()
    {
      Log.Message("Hello World");
      Log.SaveResultsAs("C:\\Temp\\Log\\", lsHTML, true, 1);
    }

    Ensure C:\Temp\Log folder exists. Are the results generated in that folder?

    • Jacobjacob44's avatar
      Jacobjacob44
      Occasional Contributor

      I have created a new project and the same scenario occurs.

      The files are generated with no issue, but the TestComplete error above still occurs stating Access is denied.

      I have checked with my config department - no access levels have changed, they also looked through folder permissions and my user account manually to ensure I still have permission, which I do.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Did you try the example code that I had provided?

    What version of TC are you using? Can you provide one screenshot of your code and the log details (enable Tools -> Docking Allowed, then rearrange your windows)

    • Jacobjacob44's avatar
      Jacobjacob44
      Occasional Contributor

      Yes, I tried the sample code you provided and encountered the same error.

      I was working on the latest version of TC (15.62), I have since rolled back to version 15.60 and the error no longer occurs. It would seem it's a bug with that version of TC. 

      Thank you for trying to assist.