public TestConfiguration CreateTestConfiguration() { string projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a testplan client instance VssConnection connection = Context.Connection; TestPlanHttpClient testPlanClient = connection.GetClient <TestPlanHttpClient>(); TestConfigurationCreateUpdateParameters TestConfigurationCreateUpdateParameters = new TestConfigurationCreateUpdateParameters() { Name = "SampleTestConfiguration1", Description = "Sample Test configuration", IsDefault = true, State = TeamFoundation.TestManagement.WebApi.TestConfigurationState.Active, Values = new List <NameValuePair>() { new NameValuePair("Operating System", "Windows 8"), } }; // Create Test configuration TestConfiguration configuration = testPlanClient.CreateTestConfigurationAsync(TestConfigurationCreateUpdateParameters, projectName).Result; Context.SetValue <TestConfiguration>("$newConfiguration", configuration); Context.Log("{0} {1}", configuration.Id.ToString().PadLeft(6), configuration.Name); return(configuration); }