I have to run db scripts before and after test execution but if I mentioned in the Before test run it's running multiple times for every thread but I need to run only once in test execution means it's to be top of all threads
Eg: Hooks file
[BeforeTestRun]
public static void BeforeTestrun()
{
Console.WriteLine("run before test");
}
[AfterTestRun]
public static void AfterTestrun()
{
Console.WriteLine("run after test");
}
In Default.srprofile Thread count=3
When run the build its showing like this
- Thread0: "run before test"
- Thread1: "run before test"
- Thread2: "run before test"
- Thread0: "run after test"
- Thread1: "run after test"
- Thread2: "run after test"
But I have to run only once above all threads and after all threads