Skip to content
Testsigma DOCS

Test Data

File Function Type


You can generate and manage various file-related data. This functionality is useful for handling files with specific attributes like file extensions, MIME types, and file names. Creating diverse file data for different applications can make file-handling tasks more efficient and organized.


Prerequisites

Before you begin, ensure that you have referred to:


Selecting File as a Function Type for Data Generator

Section titled “Selecting File as a Function Type for Data Generator”
  1. From the left navigation bar, go to Create Tests > Test Cases and create a new test case. Test Cases

  2. Use NLP to create a new step in the test case and include a placeholder for test data. NLP

  3. Click on the test data placeholder. From the Test Data Types dropdown menu, select the ! Data Generator option. Data Generator

  4. On the ! Data Generators overlay screen, select the Type to Default. This will enable you to use a collection of built-in test data generators. Default Type

  5. Select File from the Function Type dropdown list. File


  • Allows you to specify the type of file by adding a file extension. It helps in identifying the type of file.
ℹ️Example:
  • Input: None (This function does not require any specific input)
  • Output:
    • html
    • docx
    • tiff
    • js

  • Allows you to identify the format and nature of a file using MIME types. It helps applications recognize the type of file being processed.
ℹ️Example:
  • Input: None (This function does not require any specific input)
  • Output:
    • application/font-woff
    • text/xml
    • model/mesh
    • audio/vorbis

  • Allows you to assign a specific name to a file, including the file extension. It helps in organizing and identifying files.
ℹ️Example:
  • Input: None (This function does not require any specific input)
  • Output:
    • blanditiis_minus/at.json
    • nihil_autem/assumenda.css
    • quis_sit/est.wav
    • voluptatem_nisi/quas.jpeg

Generate Filename based on Provided Arguments

Section titled “Generate Filename based on Provided Arguments”
  • Allows you to generate a filename based on specific provided arguments, ensuring customized file naming.
ℹ️Examples:

Input Output
arg0: /documents
arg1: /
arg2: annual_report
arg3: .pdf
/documents/annual_report.pdf
arg0: /spreadsheets
arg1: /
arg2: sales_data
arg3: .xlsx
/spreadsheets/sales_data.xlsx
arg0: /presentations
arg1: /
arg2: company_meeting
arg3: .pptx
/presentations/company_meeting.pptx
arg0: /data
arg1: /
arg2: customer_list
arg3: .csv
/data/customer_list.csv