I'm trying to load test our application at work and I have created a web-test (coded web-test) that works perfectly locally.
It uses a helper class to create data that's required for the application like name, email etc (which must be unique for each application).
Name is returned by a method that resides in helper class as an object of Name class which is pretty basic contains 2 props First and Last.
public static Name GetRandomName()
{
// if (!File.Exists(@"..\..\..\Apps-Load-Performance-Tests\Data Files\fNames_1.csv")) return new Name();
var allLines = File.ReadAllLines(@"..\..\..\Apps-Load-Performance-Tests\Data Files\fNames_1.csv");
var maxLength = allLines.Length;
var random = new Random();
return new Name
{
First = allLines[random.Next(maxLength)],
Last = allLines[random.Next(maxLength)]
};
}
Problem is when I run a load test via Visual Studio cloud - it throws FileNotFoundException (fNames_1.csv)
In my test settings - I have 'Enable Deployment' checked and added the .csv file and the directory that contains the .csv file... but that doesn't seem to solve the problem.
I also tried adding [DeploymentItem()] attribute but no go...
What am I doing wrong? Any help or if someone can point me to right direction - I'd highly appreciate it.
Thanks in advance!