How to make a folder in an API test?

  • Questions
  • How to make a folder in an API test?
Question ID: 108785
1
0

Need my API test to create a folder to write some files into during the test. Is there an activity to do this? There seems to be one for Files but I can’t seem to find one for folder.

Marked as spam
Posted by (Questions: 364, Answers: 42)
Asked on December 27, 2018 9:10 pm
11 views
Answers (1)
1
Private answer

You have to add a Custom Code activity and add code to it to create the folder.

Here's some sample code:
Be sure to add the ''using'':

using System.IO;

var dir = @''''; //Set the desired folder path and name
if(!Directory.Exists(dir)) // if folder doesn't exist, create it
Directory.CreateDirectory(dir);

Marked as spam
Posted by (Questions: 16, Answers: 782)
Answered on December 27, 2018 9:11 pm
Thanks, this solved the problem!
( at December 27, 2018 9:12 pm)