This page is maintained for older versions of Rapise only. The latest documentation can be found at: https://rapisedoc.inflectra.com
File

File

Top  Previous  Next

 

File object. Use it to perform actions not related to a particular object. You do not need to record or learn this object, it is always automatically available in any test.

 

 

Action Summary

 

Action

Description

Append

Appends text to a file.

CreateFolder

Creates a folder.

Delete

Deletes a file.

DeleteFolder

Deletes a folder.

Exists

Checks if file exists or not.

FolderExists

Checks if folder exists.

FolderInfo

Gets information about a folder.

Include

Includes code from a file.

IncludeOnce

Includes code from a file if it was not included earlier.

Info

Gets information about a file.

Read

Reads text file.

ResolvePath

Finds the file in test folders and calculates its absolute path.

Touch

Sets file modification time to current time.

Write

Writes text file.

 

Action Detail

 

Append(fileName, text)

Appends text to a file.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file.

text

String

Text to append to the file.

 

CreateFolder(folderPath)

Creates a folder.

 

Parameters:

 

Name

Type

Description

folderPath

String

Path to a folder.

 

Delete(fileName)

Deletes a file.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to delete.

 

DeleteFolder(folderPath)

Deletes a folder.

 

Parameters:

 

Name

Type

Description

folderPath

String

Path to a folder.

 

Exists(fileName)

Checks if file exists or not.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to check.

 

Returns:

 

true if file exists, false otherwise.

 

FolderExists(folderPath)

Checks if folder exists.

 

Parameters:

 

Name

Type

Description

folderPath

String

Path to a folder.

 

Returns:

 

true if folder exists, false - otherwise.

 

FolderInfo(folderPath)

Gets information about a folder.

 

Parameters:

 

Name

Type

Description

folderPath

String

Path to a folder.

 

Returns:

 

Folder object as described here https://msdn.microsoft.com/en-us/library/1c87day3%28v=vs.84%29.aspx e.g. Path, SubFolders and Files enumeration.

 

Include(fileName)

Includes code from a file. Normally used together with eval statement, i.e.: eval( File.Include('myfile.js') )

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to load.

 

Returns:

 

Contents of the source file for evaluation.

 

IncludeOnce(fileName)

Includes code from a file if it was not included earlier. Normally used together with eval statement, i.e.: eval( File.IncludeOnce('myfile.js') )

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to load.

 

Returns:

 

Contents of the source file for evaluation.

 

Info(fileName)

Gets information about a file.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file.

 

Returns:

 

File object as described here https://msdn.microsoft.com/en-us/library/1ft05taf%28v=vs.84%29.aspx e.g. DateLastModified, Size, Type, Name, Path.

 

Read(fileName)

Reads text file.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to read.

 

Returns:

 

Contents of the text file as string.

 

ResolvePath(fileName)

Finds the file in test folders and calculates its absolute path.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to resolve path.

 

Returns:

 

Absolute path of the file.

 

Touch(fileName)

Sets file modification time to current time.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to touch.

 

Write(fileName, text)

Writes text file.

 

Parameters:

 

Name

Type

Description

fileName

String

Name of the file to write.

text

String

Text to write into the file.