Write File
This module contains step implementations for the Write file task.
Then write file
Then write "{content}" in file "{file_name}"
Create an instance of the Write file task.
Writes content into specified file (adds new line after), if the file already exist the content will be appended. Useful for traceability or observability during a test.
Both content and file name support templating.
See Write file task documentation for more information about the task.
Example:
Then write "{{ payload }}" in file "debug/request_response.log"
Then write "hello world!" in file "debug/request_response.log"
Arguments:
content
str - what to write in the file, can be base64 encodedfile_name
str - file name, which can include non-existing directory levels (will be created)
Then write temp file
Then write "{content}" in temporary file "{file_name}"
Create an instance of the Write file task, which will remove the file when test is stopped.
Writes specified content, as-is, in the specified file (no line break added), the file will be removed when the test stops. The file will be created in the first iteration, and then be a no-op task for any following iterations.
Both content and file name support templating, and content can be base64 encoded.
See Write file task documentation for more information about the task.
Example:
Then write "$env::BASE64_ENCODED_BINARY_FILE" in temporary file "certificate.bin"
Arguments:
content
str - what to write in the file, can be base64 encodedfile_name
str - file name, which can include non-existing directory levels (will be created)