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: 386, Answers: 64)
Asked on December 27, 2018 9:10 pm
34 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: 807)
Answered on December 27, 2018 9:11 pm
0
Thanks, this solved the problem!
( at December 27, 2018 9:12 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top