Write File
formatting...Module contains step implementations for the Write file task.
Create or append
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.
Example
Then write "{{ payload }}" in file "debug/request_response.log"
Then write "hello world!" in file "debug/request_response.log"
Arguments
Name | Type | Description | Default |
---|---|---|---|
content
|
str
|
what to write in the file, can be base64 encoded |
required |
file_name
|
str
|
file name, which can include non-existing directory levels (will be created) |
required |
Temporary
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.
Example
Arguments
Name | Type | Description | Default |
---|---|---|---|
content
|
str
|
what to write in the file, can be base64 encoded |
required |
file_name
|
str
|
file name, which can include non-existing directory levels (will be created) |
required |