Forum Discussion

jhunter_dps's avatar
jhunter_dps
Occasional Contributor
4 years ago
Solved

slPacker Pack Method Throwing "Unable to pack the files" Error

I am attempting to compress the .mht file of a test run's log results and attach it to an email and I am attempting to use the slPacker object as a means to do it, however when I attempt to run the "...
  • sonya_m's avatar
    sonya_m
    4 years ago

    Here's the solution from the support case that worked:

     

    >>

    To resolve this issue, please change the first two lines to the following:

     

    workDir = Project.ConfigPath + "ExportedResults\\"
    packedResults = Project.ConfigPath + "CompressedResults\\"


    Afterwards, the test will pack without issue.


    The reason the file is not getting packed is because when the first two lines are "\\Exp" and "\\Com", the project path becomes:

     

    ProjectPath\\\\Exp


    Which is not a valid path. When the log is exported afterwards, the path then becomes:

     

    ProjectPath\\\\ExportedResultsTest_DLS


    Which is also not a valid path. Because of this, the results are placed in the project folder. TestComplete tries to export the results of an empty folder to a folder called:

     

    ProjectPath\\\\CompressedResults


    Which doesn't exist as well. This is why the error was occurring. Putting the slashes after the names will create valid folder names which should resolve all of these issues.

    <<