I've got this piece of code that I am looping 100 times. As you can see below the number of loops is declared in the response I get from GET method. So it changes over time depending which number is inside the GET response body.
Inside the body I also have "threads": 3
So i would like to bind the number for how many threads are needed for the POST method (below)
Is it possible to do it? I've never done it before & I don't know where to begin.
for (var i = 0; i < test.loop; i++) //looping 100 times
{
Console.WriteLine("Loop count: " + i.ToString());
var newClient = new RestClient(url);
var newRequest = new RestRequest(Method.POST);
newRequest.AddHeader("Accept", "application/json");
newRequest.AddHeader("Authorization", $"{testCases.header[0].auth}");
newRequest.AddHeader("content-type", "application/json");
newRequest.AddJsonBody(bodyRequest);
var queryResult = newClient.Execute<object>(request);
var content = JsonConvert.SerializeObject(queryResult.Data);
Assert.IsTrue(content.Contains(testing.result.httpCode));
Assert.IsTrue(content.Contains(testing.result.reponseAssert.ToString()));
}