SaveAs Method (ALog)

Saves the log to the given location (URL).

Syntax

enSaveLog = Object.SaveAs ( sURL, [bAppend] )

The SaveAs method syntax has the following parts:

 

Name

Type

Description

enSaveLog

enumALogSave

Return the status of the save operation

Object

ALog

ALog control

sURL

Val BString

The URL or file name where the contents of the control will be saved. The file extension of the file will determine the file format used to save the test log file.

bAppend

Val Bool

When True the function will append the log window contents to the specified file. Default value is False - overwrite the file contents.

Where

enumALogSave can have one of the following values:

 

Name

Value

Description

alogSaveOk

0 *

Successful save

alogSaveCanceled

1

User selected Cancel when prompt to provide a file name to select

alogSaveFailed

 

2

Failed to save the file since ATEasy cannot create, open or save the specified file or the ALog control is not in ready state

Comments

If the sUrl parameter is omitted, the Save As dialog box will appear asking the user to select a file name and file type.

The saved file format is determined by the following rules:

        If sURL has an filename extension of "txt", for example, mylog.txt, then the log will saved as text format.

        If sURL has an extension of "htm", then the log will be saved as HTML format.

        If sURL has an extension of "mht", then the log will be saved as Web Archive, Single .mht file format. (v7.0)

        If sURL has an extension of "pdf", then the log will be saved as Portable Document File .pdf file format, PDF format is not supported on Windows released prior to Windows 10 (v14/2025)

        If any other filename extension is used for sUrl, the log will be saved according to the format specified by the PlainText property.

If the sURL is given without a directory, the file is saved to the application current directory.

Example

The following example will save the contents of the ALog control to the file c:\testalpha\test1.txt:

if log1.SaveAs("c:\\testalpha\\test1.txt")=alogSaveFailed

MsgBox("Error saving Log File")

endif

Applies to

ALog

See Also

PlainText, ReadyState, Save, SaveLog