File and Folder Operations
Last updated
Last updated
Description: This keyword or action instructs Avo Assure Client to beautify the content given in the input as well as the content from the file path given in the input (.xml and .json files) and save the beautified results in the output variable or the file path specified in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
beautify
<XML/JSON_file path OR XML/JSON_content>; XML/JSON
{Variable} OR Direct_File_Path_with_Extension
XML/JSON content
Static Values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, {beautiful} variable will contain the beautified format of the JSON content provided.
Description: This keyword or action instructs Avo Assure Client to compare the content of the files whose file paths are specified in the input (.txt, .xml, and .json files) and save the result in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
compareFiles
<XML/JSON/Txt_file path1>; <XML/JSON/Txt_file path2>; Selective/all (Optional)
{Variable}
XML/JSON/Txt file paths
Find the snippet of the keyword below:
In the above example, after the test case debug, {compareFiles} variable will contain the result of removed/added lines between the compared files.
Description: This keyword or action instructs Avo Assure Client to compare the inputs specified in the input (.xml and .json content) and save the result in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
compareInputs
<XML/JSONcontent1>; <XML/JSONcontent2>; Selective/all (Optional)
{Variable}
Raw beautified XML/JSON content
Static values
Dynamic Variables
Note: Outputs for compare files and compareInputs are as follows:
JSON and text:
- If a line is removed from the first input
+ If a line is added in the second input
? shows the delta (difference) of the two files
.xml: \ tags will be there with the following params:
diff:update-attr – XML attribute is updated
diff:delete- line deleted
diff:insert- line inserted
diff:delete-attr- attribute deleted
diff:add-attr- XML attribute added
Find the snippet of the keyword below:
In the above example, after the test case debug, {compareInputs} variable will contain the result of removed/added lines between the compared files.
Description: This keyword or action instructs Avo Assure Client to normalize/flatten a specified special PDF (Adobe LiveForms [that can be opened/launched only via Acrobat Reader DC]).
Keyword
Input Syntax
Output Syntax
Supported Input Formats
normalizePDF
<PDF Reader FilePath>;<Source PDF FilePath>;<Destination Path>;<1(overwrite)/0(normal)>(Optional)
{Variable}
Text
Static values
Dynamic variables
Find the snippet of the keyword below:
In the above example after the test case debug, it normalizes/ flattens the specified special PDF file and places the flattened PDF file in the destination path specified and the execution status “True” / “False” will be stored in the output variable, if provided.
NOTE: The following are the pre-requisites for using this keyword.
The system where the ICE is running must have the PDF Reader (Acrobat Reader DC) installed.
The screen must not be locked when normalizePDF keyword is used for PDFs.
Limitation: This keyword is not supported on Windows 8 systems.
Description: This keyword or action instructs Avo Assure Client to fetch the content from the file based on line number (.txt and .pdf files) and save the results in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
getContent
For Text : <file path>; <line number>(optional)
For PDF : <PDF_Filepath>;<pageNumber>; <start string(optional)>;<EndString(optional)>;<image/all/text(optional)>
{Variable}
String
Static values
Dynamic variables
If Start string Is Empty : <PDF_Filepath>; <pageNumber>; <EndString>
Find the snippet of the keyword below:
In the above example, after the test case debug, {result} variable contains value present in line no. 36 of the User_ID text file.
Note:
For text files, if the getContent keyword is used without specifying any line number, then the entire text file content will be fetched.
For PDF files, if the getContent keyword is used without specifying any start string and end string, then the entire PDF file content will be fetched.
As PDF files can contain both images and text, Avo Assure provides users the ability to fetch text data from the images in the PDF file. This can be performed by specifying the type of object in the PDF from which the text should be fetched. To perform such an action, the object type must be specified in the last argument of the getContent keyword’s input. This argument is case insensitive and can take the following values:
Image
All
Text (default)
getContent supports special PDF files (Adobe LiveForms [that can be opened/launched only via Acrobat Reader DC]) after these files are normalized. These special PDF files can be normalized using the ‘normalizePDF’ keyword, and then the normalized PDF can be specified as the input file for the ‘getContent’ keyword. Refer to the ‘normalizePDF’ Keyword in case of this scenario.
Limitation: For PDF files, when input value involves images (image/all), the text fetched from the images will not be in the order of the images in the PDF.
Output formats vary depending on the input specified by the user as follows:
Input Value
Output Format
Sample Output
Image
List of strings (text fetched from images)
[‘This is text fetched from image’, ’Text fetched from another image’]
All
List whose first item is a string (text fetched from PDF) and the second item is a list of strings (text fetched from images)
[‘text fetched from PDF’, [‘Image text’, ‘Another Image text’]]
Text
String (text fetched from PDF)
‘Text fetched from PDF’
Description: This keyword or action instructs Avo Assure Client to fetch the line number of the given content in the specified file and save the result in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
getLineNumber
For txt: <file path>; <content> For excel: <file path>; <sheetname>;<content>
{Variable}
Supported file types: .txt, .xls, .xlsx
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, {result} variable contains the line number of the string “Access” from the Excel sheet. To view/use the returned value, the user should provide the output dynamic variable in the array. For example: {result[0]}, {result[1]}.
Description: This keyword or action instructs Avo Assure Client to replace the content in the file with the given content.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
replaceContent
Txt: <file path>; <content to replace>; <content> Excel: <file path>; <sheetname>; <content to replace>; <content>
{Variable}
Supported file types: .txt, .xls, .xlsx
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, in the provided Excel sheet, in place of the string “Access”, “Access Control” would be replaced.
Description: This keyword or action instructs Avo Assure Client to verify if the specified content is present in the file.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
verifyContent
For Text: <file path>; <content to verify>;<abs>(Optional) Excel: <file path>; <sheetname>; <content to verify>;<abs>(Optional)
{Variable}
Supported file types: .txt, .xls, .xlsx
Static values
Dynamic Variables
NOTE:
The comparison for verification is done line by line (if text file) or row by row (if Excel file) with the specified content. If the specified content is to be verified against the entire text file’s/ excel sheet’s content, then the ‘abs’ argument must be specified.
Limitation: verifyContent keyword is not supported for content consisting of Semicolon (;), as Semicolon (;) is used as a separator in Avo Assure.
Find the snippet of the keyword below:
In the above example, after the test case debug, if the string “Access Control” is available in the provided Excel sheet.
Description: This keyword or action instructs Avo Assure Client to compare the two images present in the paths provided in the input field.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
verifyFileImages
<image1path>; <image2path>
{Variable}
Supported file types: .png, .jpeg, .jpg, .gif
Find the snippet of the keyword below:
In the above example, after the test case debug, verifies if both the images, “SLKLogo.png” and “Logos_SLK_Purple,” both are same. In the {result} variable, “True” will be returned if both the images are matching else, “False”.
Description: This keyword or action instructs Avo Assure Client to compare and get the similarity percentage of the two images present in the paths provided in the input field.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
imageSimilarityPercentage
<image1path>; <image2path>
{Variable}
Supported file types: .png, .jpeg, .jpg, .gif
Find the snippet of the keyword below:
In the above example, after the test case debug, the images “andyLogo.png” and “download.png” will be compared. In the {result} variable, the similarity percentage of the images compared will be returned.
Description: This keyword or action instructs Avo Assure Client to compare the content of the files word by word.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
compareContent
For Text: <file1path>; <file2path> Excel: <file1path>, <sheet name>; <file2path><sheet name>
{Variable}
Supported file types: .txt, .xls, .xlsx
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, verifies if both the file contents are the same. In the {result} variable, “True” will be returned if both the file contents are matching, else “False”.
Description: This keyword or action instructs Avo Assure Client to clear all the file contents present in the path provided.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
clearFileContent
For Text: <file location>; <file name> Excel: <file location>, <file name>; <sheet name>
{Variable}
Supported file types: .txt, .xls/.xlsx, .xml
Static values
Dynamic Variables
Note: The file should be closed during this particular keyword debug/execution.
Find the snippet of the keyword below:
In the above example, after the test case debug, it clears the content of the file specified “Clear.xls”.
Description: This keyword or action instructs Avo Assure Client to write or append the given content to the specified file.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
writeToFile
Text: <file path>; <content to write>; Newline <file path>; <sheet name>; <Content to write>; Newline
XML/JSON: <file path>; <content to write>
{Variable}
Supported file types: .txt, .xls/.xlsx, .xml
Static values
Dynamic Variables
Note:
The file should be closed during this particular keyword debug/execution.
Write to file keyword supports an optional extra parameter “Newline”. When this parameter is encountered, the following text is written to a new line. Content to write: There can be multiple dynamic variables.
Find the snippet of the keyword below:
In the above example, after the test case debug, it clears the content of the file specified “Clear.xlsx”.
Description: This keyword or action instructs ICE to perform the comparison operation between a pair of Excel files OR CSV files OR an Excel and a CSV file, depending on the files specified by the user in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
cellByCellCompare
<CSV/Excel file path1>;<Sheet name(optional)>;<CSV/Excel file path2>;<Sheet name(optional)>
{Variable}
.xls/.xlsx and .csv
Find the snippet of the keyword below:
In the above example, after the test case debug, the comparison results between the 2 files will be written in variable {result}.
Description: This keyword or action instructs Avo Assure client to perform the comparison operation on a selection between a pair of Excel files OR CSV files OR an Excel and a CSV file, depending on the files specified by the user in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
selectiveCellCompare
<CSV/Excel file path1>; <Sheet name (optional)>; <Cell selection>; <CSV/Excel file path2>; <Sheet name (optional)>; <Cell selection>; <IgnoreCase (optional)>
{Variable}
.xls/.xlsx and .csv
Note: If the final argument by the user is specified as ‘ignorecase’ (case insensitive), then the comparison done between the selected cells will be by ignoring the case of the cell values.
Find the snippet of the keyword below:
In the above example, after the test case debug, the comparison results between the selected cells of the 2 files will be written in variable {result}. If {result} consists of a file path with an editable file name, then the comparison results will be written into that editable file.
Description: This keyword or action instructs Avo Assure Client to find the image occurrences within a PDF that match the image provided in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
findImageInPDF
<PDF_file_path>; <Image_file_path>
{Variable}
Text
Static values
Dynamic Variables
Output format: The output value will be a list containing list of data that provides the find results.
Output Syntax
On ICE Console
[[pgno,count,[listOfAlignments]],[...],[...],...]]
In ICE Logs
[[pgno,count,[listOfAlignments],[listOfMatchPercentage]],[...],[...],...]
Output Data Description
pgno
Specifies the current page number.
count
Specifies the number of times the specified image has been found on the current page
listOfAlignments
Specifies the alignments of each image found on the current page. This is a list of alignment positions which are in accordance with the occurrence index of the images. Alignment positions can be as follows:
Top-left and top-right
Middle-left and middle-right
Bottom-left and bottom-right
listOfMatchPercentage
[This will only be available in logs] Specifies the percentage of match between the image specified and the image found on the PDF page. This is a list of match percentages which are in accordance with the occurrence index of the images.
Find the snippet of the keyword below:
In the above example, after the test case debug, the number of times the image is found within the specified PDF is displayed on the ICEngine Console. The dynamic variable {result} will contain: [[1, 1, [top-right]], [3, 2, [middle-left, bottom-right]]].
Description: This keyword or action instructs Avo Assure Client to compare two PDF files specified by the user and save the comparison results in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
comparePDFs
<PDF_file_path1>;
<PDF_file_path2>;
<selective/all(optional)>;
<pagewise/complete (optional)>
{Variable}
Text
Static values
Dynamic Variables
Note: The comparison can be performed in 4 combinations with the variations/input options as described below:
Selective: This specifies that only the differences must be fetched.
All: This specified that all the compared content must be fetched. By default (if the user has not specified the option), the ‘All’ option will be considered.
Pagewise: This specifies that the comparison must be done pagewise (page 1 of PDF1 must be compared with page 1 of PDF2, page 2 of PDF1 must be compared with page 2 of PDF2, and so on). By default (if the user has not specified the option), the ‘Pagewise’ option will be considered.
Complete: This specifies that the comparison must be done with all pages (page 1 of PDF1 must be compared with all pages of PDF2, page 2 of PDF1 must be compared with all pages of PDF2, and so on).
Output format: The output value will be a list containing the list of data that provides the comparison results.
Output Syntax
On ICE Console
[[pageno,error/result,[number of added images,number of deleted images,number of matching images],pageMatched(in case complete matching)],[....]]
In ICE Logs
[[pageno,error/result,[number of added images,number of deleted images,number of matching images],pageMatched(in case complete matching), matchPercentage],[...]]
Output Data Description
pageno
Specifies the current page number.
error/result
Specifies the comparison result within the pages, if any.
Changes are depicted as follows:
Addition is depicted as ||+++<content>+++||
Deletion is depicted as ||---<content>---||
number of added images
Specifies the number of added images in the current page on comparison with the compared page.
number of deleted images
Specifies the number of deleted images in the current page on comparison with the compared page.
number of matching images
Specifies the number of same images in the current page on comparison with the compared page.
pageMatched
Specifies the page number of the ‘compared with’ page. This is specified only in the case of complete matching.
matchPercentage
[This will only be available in logs] Specifies the percentage of match between the pages. This is a list of match percentages which are in accordance with the PDF pages compared.
Find the snippet of the keyword below:
In the above example, after the test case debug, the PDFs are compared with each other based on the method (selective/all + pagewise/complete) specified by the user, and the comparison results are saved in the output variable {result}.
Description: This keyword or action instructs Avo Assure Client to save the file, which opens in a new tab, with the file name provided in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
saveFile
<file_path>; <file_name>
{Variable}
Text
Static Values
Dynamic Variables
Note:
This keyword is applicable only for web app type.
If any of the files, either .txt or .pdf or .xml, opens in a new tab, then the user can save that file in local.
Before the saveFile step, the user needs to provide the sendFunctionKeys step to send the function key to save the file, which is opened in a new tab. (Send function keys differ from browser to browser. For example, for IE: CTRL+SHIFT+S and for Chrome: CTRL+S). The user has to provide proper sendFunctionKeys.
There is no need to provide the Extn in the input. ICE will save the file with extn it has downloaded
Find the snippet of the keyword below:
In the above example, after the test case debug, if the “Student.txt” file will be saved in the D drive, “True” will be stored in {result} variable else “False”.
Description: This keyword or action instructs Avo Assure Client to create a new folder in the specified path with the name provided in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
createFolder
<folder_path>; <folder_name>
{Variable}
Text
Static values
Dynamic Variables
Note: The given path should already exist.
Find the snippet of the keyword below:
In the above example, after the test case debug, a new folder, “TestFolder” will be created in the given path “D:\.”
Description: This keyword or action instructs Avo Assure Client to verify if the folder exists or not in the specified path.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
verifyFolderExists
<folder_path>; <folder_name>
{Variable}
Static values
Dynamic Variables
Note: The given path should already exist.
Find the snippet of the keyword below:
In the above example, after the test case debug, if the folder exists, “True” will be stored in {result} variable, else “False”.
Description: This keyword or action instructs Avo Assure Client to rename the folder with the new folder name specified by the user.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
renameFolder
<folder_path>; <folder_name-old>; <folder_name-new>
{Variable}
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, the folder named “TestFolder” will be renamed to “Softwaretest”.
Description: This keyword or action instructs Avo Assure Client to delete the folder with the folder path provided in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
deleteFolder
<folder_path>;<folder_name-old>; 1<indicates force delete- optional>
{Variable}
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, the folder named “Softwaretest” will be deleted and the {deleteResult} variable will hold the value “True”.
Description: This keyword or action instructs Avo Assure Client to create a new file in the specified path, with the name and type provided in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
createFile
<file_path>; <file_name.ext>
{Variable}
.txt. .xlsx, .xls, .pdf, .gif, .doc, .xml
Static values
Dynamic Variables
Note: All the folders specified in the path should already exist.
Find the snippet of the keyword below:
In the above example, after the test case debug, a new file “Test.txt” will be created in the given path “D:\Testing”.
Description: This keyword or action instructs Avo Assure Client to verify whether the file exists in the specified path.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
verifyFileExists
<file_path>; <file_name.ext>
{Variable}
All files
Static values
Dynamic Variables
Note: All the folders specified in the path should already exist.
Find the snippet of the keyword below:
In the above example, after the test case debug, if the file exists, “True” will be stored in {result} variable, else “False”.
Description: This keyword or action instructs Avo Assure Client to rename the file with the new file name specified by the user.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
renameFile
<file_path>; <file_name-old.ext>; <file_name-new.ext>
{Variable}
.txt. .xlsx, .xls, .pdf, .gif, .doc, .xml
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, the file named “Test.txt” will be renamed to “Softwaretest.txt”.
Description: This keyword or action instructs Avo Assure Client to delete the file with the file name provided in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
deleteFile
<file_path>; <file_name.ext>
{Variable}
.txt. .xlsx, .xls, .pdf, .gif, .doc, .xml
Static values
Dynamic Variables
Note: The file should be closed during this particular keyword debug/execution.
Find the snippet of the keyword below:
In the above example, after the test case debug, the folder named “Excel123.xlsx” will be deleted, and the {deleteResult} variable will hold the value “True”.
Description: This keyword or action can be used by instructing Avo Assure Client to move a file or folder to the specified destination folder specified by the user in the input. It also can be used to save the file in a different possible format or even compress a folder.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
moveFileFolder
<Source_Path>;<Destination_Path>;<1(overwrite)/ 0(normal)>(Optional); <extension (ex:.csv)>(optional)
{Variable}
Text
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, the file name ‘Test.txt’ will be moved under the ‘Softwaretest’ folder.
Note: The folder to be moved should NOT end with "\".
Description: This keyword or action can be used by instructing Avo Assure Client to copy a file or folder to the specified destination folder specified by the user in the input. It also can be used to save the file in a different possible format or even compress a folder.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
copyFileFolder
<Source_Path>;<Destination_Path>;<1(overwrite)/0(normal)>(Optional);<extension (ex:.csv)>(optional)
{Variable}
Text
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, the file name ‘Test.txt’ will be copied under the ‘Softwaretest’ folder.
Note: The folder to be moved should NOT end with "\".
Description: This keyword or action instructs Avo Assure Client to search for a file within the path specified by the user in the input.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
findFilePath
<file_name>; <folder_path>
{Variable}
Text
Static values
Dynamic Variables
Find the snippet of the keyword below:
In the above example, after the test case debug, the file location is fetched if the file is found. Otherwise, ‘False’ will be returned in the output variable.
Description: This keyword or action fetches the number of pages from a pdf file.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
getPageCount
<filepath>; <filename>
(Optional)
Text
Static values
Dynamic Variables
Note: This keyword only supports PDF format files.
Find the snippet of the keyword below:
In the above example, after the test case debug, the operation will fetch the total number of pages available in PDF files.
Limitations:
The getPageCount keyword is not supported for ".xls/.docx" files. In addition, this keyword will work only for “Doc’s file” in Windows OS.
Description: This keyword or action instructs Avo Assure Client to compare two PDF files specified by the user and save the comparison results in the output variable.
Keyword
Input Syntax
Output Syntax
Supported Input Formats
comparePDFs
<PDF_file_path1>;
<PDF_file_path2>;
<selective/all(optional)>;
<pagewise/complete (optional)>
{Variable}
Text
Static values
Dynamic Variables
Find the snippet of the keyword below: