Skip to content

Write File

This module contains step implementations for the Write file task.

Then write file

Then write "{content}" in file "{file_name}"

[view_source]

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
  • file_name str - file name, which can include non-existing directory levels (will be created)