Skip to content

Testing with Bqurious > Actions

File System

The file system keywords are helpful in performing actions on various files.

Suppose you wish to create a .txt file within a folder, append some text on that file for further use.

Structure :

createFolder <parameter>

createFile <parameter>

appendTextToFile <parameter>

<further steps to execute>

IMPORTANT

When you mention the file name in the parameter of any action keyword, please provide the file name with extension (for example, file1.txt or file1.doc) so that the specific file can be selected to work on.

ActionParametersExample Usage
appendTextToFile Web, Mobile


---

To append content (mentioned in Parameter 1) to an existing file (mentioned in Parameter 2) located in file system (mentioned in Parameter 3).
Param 1 : Text to append on the file Param 2 : Name of the file that needs changes Param 3 : Location of the fileExample :
appendTextToFile : <Text to Append : Bqurious Automation is world's first automation on cloud> <File Name : bqFile.txt> <Location : d:/bqLocation>
Appends Bqurious Automation is world's first automation on cloud in file bqFile.txt located at d:/bqLocation

> [!IMPORTANT] File with name bqFile.txt should be created in advance.
compareCSVFiles Web, Mobile


---

To compare two files located at (location of first file mentioned in Parameter 1) and (location of the second file mentioned in Parameter 2). Header present - (mentioned in Parameter 3).
Param 1 : Path of the first file Param 2 : Path of the second file Param 3 : File contains header (true / false)Example :
compareCSVFiles : <First File Path : d:/Test/File1.csv> <Second File Path : d:/Test/File2.csv> <Contains Header : false>
Compare files d:/Test/File1.csv and d:/Test/File2.csv where these files headers are not present

> [!IMPORTANT] Files File1.csv and File2.csv should be created in advance
compareCSVFilesWithFilter Web, Mobile


---

To compare two files located at (location of first file mentioned in Parameter 1) and (location of the second file mentioned in Parameter 2) with filter (filter condition mentioned in Parameter 3).

> [!NOTE] If filter is not provided then only the matched columns will be compared.
Param 1 : Path of the first file Param 2 : Path of the second file Param 3 : Filter to compare filesExample :
compareCSVFilesWithFilter : <First File Path : d:/Test/File1.csv> <Second File Path : d:/Test/File2.csv> <Filter : companyName = bqurious>
Compares files d:/Test/File1.csv and d:/Test/File2.csv with filter companyName = bqurious

> [!IMPORTANT] Files File1.csv and File2.csv should be created in advance
createFolder Web, Mobile


---

To create the folder (mentioned in Parameter 1) in the file system at location (mentioned in Parameter 2) .
Param 1 : Name of the folder to create Param 2 : Location to create folderExample :
createFolder : <Folder Name : bqFolder> <Location : d:/bqLocation>
Creates folder bqFolder in file system at location d:/bqLocation.
copyFolder Web, Mobile


---

To copy the folder (mentioned in Parameter 1) from source location (mentioned in Parameter 2) to specified destination location (mentioned in Parameter 3).
Param 1 : Name of the folder to copy Param 2 : Location to copy folder from (Source Location) Param 3 : Location to copy folder to (Destination Location)Example :
copyFolder : <Folder Name : bqFolder> <Source Location : d:/bqSourceLocation> <Destination Location : d:/bqDestinationLocation>
Copies folder bqFolder from source location d:/bqSourceLocation to destination location d:/bqDestinationLocation.

> [!IMPORTANT] Folder with name bqFolder should be created in advance.
createFile Web, Mobile


---

To create the file (mentioned in Parameter 1) in the file system at location (mentioned in Parameter 2).
Param 1 : Name of the file to create Param 2 : Location to create fileExample :
createFile : <File Name : bqfile.txt> <Location : d:/bqLocation>
Creates file bqfile.txt in file system at location d:/bqLocation.
copyFile Web, Mobile


---

To copy the file (mentioned in Parameter 1) from source location (mentioned in Parameter 2) and paste it to destination location (mentioned in Parameter 3).
Param 1 : Name of the file to copy Param 2 : Location to copy file from (Source Location) Param 3 : Location to copy file to (Destination Location)Example :
coppyFile : <File Name : bqfile.txt> <Source Location : d:/bqSourceLocation> <Destination Location : d:/bqDestinationLocation>
Copies file bqfile.txt from source location d:/bqSourceLocation to destination location d:/bqDestinationLocation.

> [!IMPORTANT] File with name bqfile.txt should be created in advance.
deleteFolder Web, Mobile


---

To delete the folder (mentioned in Parameter 1) located at (mentioned in Parameter2) from file system.
Param 1 : Name of the folder to delete Param 2 : Location to delete folderExample :
deleteFolder : <Folder Name : bqFolder> <Location : d:/bqLocation>
Deleted folder bqFolder in file system at location d:/bqLocation.

> [!IMPORTANT] Folder with name bqFolder should be created in advance.
deleteFile Web, Mobile


---

To delete the file (mentioned in Parameter 1) from file system location (mentioned in Parameter 2).
Param 1 : Name of the file to delete Param 2 : Location to delete fileExample :
deleteFile : <File Name : bqfile.txt> <Location : d:/bqLocation>
Deletes file bqfile.txt in file system at location d:/bqLocation.

> [!IMPORTANT] File with name bqfile.txt should be created in advance.
moveFolder Web, Mobile


---

To move the folder (mentioned in Parameter 1) from source location (mentioned in Parameter 2) to specified destination location (mentioned in Parameter 3).
Param 1 : Name of the folder to move Param 2 : Location to move folder from (Source Location) Param 3 : Location to move folder to (Destination Location)Example :
moveFolder : <Folder Name : bqFolder> <Source Location : d:/bqSourceLocation> <Destination Location : d:/bqDestinationLocation>
Moves folder bqFolder from source location d:/bqSourceLocation to destination location d:/bqDestinationLocation.

> [!IMPORTANT] Folder with name bqFolder should be created in advance.
moveFile Web, Mobile


---

To move the file (mentioned in Parameter 1) from source location (mentioned in Parameter 2) to specified location (mentioned in Parameter 3).
Param 1 : Name of the file to move Param 2 : Location to move file from (Source Location) Param 3 : Location to move file to (Destination Location)Example :
moveFile : <File Name : bqfile.txt> <Source Location : d:/bqSourceLocation> <Destination Location : d:/bqDestinationLocation>
Moves the file bqfile.txt from source location d:/bqSourceLocation to destination location d:/bqDestinationLocation.

> [!IMPORTANT] File with name bqfile.txt should be created in advance.
readFileAndStore Web


---

To read the file (mentioned in Parameter 1) from the location (mentioned in Parameter 2) and store the contents in variable (mentioned in Parameter 3).
Param 1 : Name of the file to read Param 2 : Location of the file Param 3 : Variable name to store file contentsExample :
readFileAndStore : <File Name : bqfile.txt> <Source Location : d:/bqSourceLocation> <In Variable : bqVariable>
Reads the file bqfile.txt from location d:/bqSourceLocation and stores contents into variable

> [!IMPORTANT] File bqfile.txt should be present at location d:/bqSourceLocation
writeToFile Web, Mobile


---

To overwrite the existing file (mentioned in Parameter 2) located in file system (mentioned in Parameter 3) with new text (mentioned in Parameter 1).
Param 1 : Text to write on the file Param 2 : Name of the file on which text needs to be written Param 3 : Location of the fileExample :
writeToFile : <Text to Write : Hello, Welcome to BQurious> <File Name : bqFile.txt> <Location : d:/bqLocation>
Writes Hello, Welcome to BQurious in file bqFile.txt located at d:/bqLocation.

> [!IMPORTANT] File with name bqFile.txt should be created in advance.