Search code examples
k6

can i write to file in k6 load testing framework?


I am using k6 for our performance test suite.I want to write into file if response code in not equal to 200. Is there anyway to write in file in default method or out side of it?


Solution

  • There are no direct ways to write to files for mostly security and portability issues (especially in a distributed environment).

    You can probably use console.log and use --console-output cli flag to redirect that to a file.