So, like many others, I am trying to access .runsettings parameters via BeforeTestRun using parameter injection as shown in your official documentation here:
Problem is, it doesn't work for me. Whenever I try, my tests get skipped with the following error in the SpecRun log file:
read #0 error: System.MemberAccessException: Cannot create an instance of Microsoft.VisualStudio.TestTools.UnitTesting.TestContext because it is an abstract class.
Please help. Here is a code snippet from my solution.
public abstract class Hooks : SeleniumCore
public static void BeforeTestRun(TestContext testContext)
var runEnv = testContext.Properties["runEnvironment"].ToString();
Please sign in to leave a comment.