Forum Discussion

MGN's avatar
MGN
Occasional Contributor
6 years ago

Log.SaveResultsAs Reporting Error for lsXML Option

Test Machine Information - VM running Windows 10, with TestComplete 14.1 installed, and coding in VBScript.

 

Was hoping to get some feedback to see if anyone else has had this issue.  When using the Log.SaveResultsAs method ( https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/saveresultsas.html ) to export to a folder location using the lsXML option, the full TestComplete log reports that the operation failed.  However, when I go to look at the folder it appears that all necessary files have been saved to the location.  From this I went and tested other Log.SaveResultsAs options, and none of those reported an error.  This included the lsZip option that saves the xml export files in a zip file.  Below is my sample code testing this functionality out.  From all of that, has anyone seen this occur for them when using the Log.SaveResultsAs lsXML option?

 

Sub testlogfunctions
Dim html_Path
Dim xml_Path
Dim mht_Path
Dim zip_Path
Dim packedhtml_Path

Call Log.Message("Post to log to have data for log save")
Call aqutils.Delay(500)
Call Log.SaveToDisk()
Call aqutils.Delay(500)
html_Path = "C:\TEMP\html_Folder\"
xml_Path = "C:\TEMP\xml_Folder\"
mht_Path = "C:\TEMP\mht_Folder\file.mht"
zip_Path = "C:\TEMP\zip_Folder\file.zip"
packedhtml_Path = "C:\TEMP\packedhtml_Folder\file.zip"

'lsXML = 0
If Log.SaveResultsAs(xml_Path, 0, False, 0) <> True Then
Log.Error("SaveResultsAs failed for XML")
Else
Log.Message("SaveResultsAs successful for XML")
End If
Call aqutils.Delay(500)

'lsHTML = 1
If Log.SaveResultsAs(html_Path, 1, False, 0) <> True Then
Log.Error("SaveResultsAs failed for HTML")
Else
Log.Message("SaveResultsAs successful for HTML")
End If
Call aqutils.Delay(500)

'lsMHT = 2
If Log.SaveResultsAs(mht_Path, 2, False, 0) <> True Then
Log.Error("SaveResultsAs failed for MHT")
Else
Log.Message("SaveResultsAs successful for MHT")
End If
Call aqutils.Delay(500)

'lsZip = 3
If Log.SaveResultsAs(zip_Path, 3, False, 0) <> True Then
Log.Error("SaveResultsAs failed for Zip")
Else
Log.Message("SaveResultsAs successful for Zip")
End If
Call aqutils.Delay(500)

'lsPackedHTML = 4
If Log.SaveResultsAs(packedhtml_Path, 4, False, 0) <> True Then
Log.Error("SaveResultsAs failed for Packed HTML")
Else
Log.Message("SaveResultsAs successful for Packed HTML")
End If
Call aqutils.Delay(500)

End Sub

  • MGN's avatar
    MGN
    6 years ago

    The response I received from support was verifying the issue, with the potential reason possibly being that since I was specifying a folder path with the xml option that this doesn't actually generate a xml file, but rather the tclog file.  From that, since an xml file wasn't generated, the error was logged.  Since we aren't tied to using that method, we'll go forward with one of the others that don't log an error. 

     

    And currently we are just trying to get up to version 14.1, so I would not know the functionality of this feature in 14.2.