Description
Returns the number of messages with links to files (that is, messages added via Log.File
) posted to the test log during the current run of the current test item.
Declaration
Applies To
The property is applied to the following object:
Property Value
An integer value that means the number of file messages in the test log.
Example
The code below obtains the total number of files posted to the test log and then checks whether this number is not null.
JavaScript, JScript
function FileCount()
{
// ...
// Obtains the total number of files
// posted to the current test log
var FileCount = Log.FileCount;
// Checks whether there are some files
if ( FileCount > 0 )
Log.Message("There is(are) " + FileCount + " file(s) in the test log.");
else
Log.Message("There are no files in the test log.");
}
Python
def FileCount():
# ...
# Obtains the total number of files
# posted to the current test log
FileCount = Log.FileCount
# Checks whether there are some files
if FileCount > 0:
Log.Message("There is(are) " + str(FileCount) + " file(s) in the test log.")
else:
Log.Message("There are no files in the test log.")
VBScript
Sub FileCount()
' ...
' Obtains the total number of files
' posted to the current test log
FileCount = Log.FileCount
' Checks whether there are some files
If FileCount > 0 Then
Log.Message("There is(are) " & FileCount & " file(s) in the test log.")
Else
Log.Message("There are no files in the test log.")
End If
End Sub
DelphiScript
function FileCount;
var FileCount;
begin
// ...
// Obtains the total number of files
// posted to the current test log
FileCount := Log.FileCount;
// Checks whether there are some files
if ( FileCount > 0 ) then
Log.Message('There is(are) ' + FileCount + ' file(s) in the test log.')
else
Log.Message('There are no files in the test log.');
end;
C++Script, C#Script
function FileCount()
{
// ...
// Obtains the total number of files
// posted to the current test log
var FileCount = Log["FileCount"];
// Checks whether there are some files
if ( FileCount > 0 )
Log["Message"]("There is(are) " + FileCount + " file(s) in the test log.");
else
Log["Message"]("There are no files in the test log.");
}
See Also
Test Results
File Method
FolderFileAndLinkCount Property
WrnCount Property
MsgCount Property
EvnCount Property
ImgCount Property
ErrCount Property
LinkCount Property
FolderCount Method