File info (FR)

Perfecto Command

perfecto:file:info

Purpose

For Web tests, provides details about a specific file created during the test run.

If a test includes files, you can use this command to receive details about a specific file, such as the time the file was created, accessed, or last modified, and the file size. Before running this command, run the file list command to retrieve a list of files. After running this command, you can run the download file command.

Parameters

Name Type Possible Values Description
filename String

The name of the file on the remote machine for which you want to get details.

Example:
annual-report-2019.pdf

Return Value

String

Example

Copy

Java sample

//declare the Map for script parameters
String filename = "annual-report-2019.pdf";
Map<String, Object> params = new HashMap<>();
params.put("filename", filename);
Map<String, Object> fileInfo = (Map<String, Object>)  driver.executeScript("perfecto:file:info", params);
fileInfo.entrySet().forEach(info -> {
    System.out.println(info.getKey() + ":" + info.getValue());
});

Related commands

perfecto:file:download

perfecto:file:list