using (TfsTeamProjectCollection collection = new TfsTeamProjectCollection(TfsTeamProjectCollection.GetFullyQualifiedUriForName("<YourTFSServerURL>")))
{
ITestManagementService tcmService = collection.GetService<ITestManagementService>();
ITestManagementTeamProject project = tcmService.GetTeamProject("<YourTFSProject>");
//Get configuration, which contains configuration values
ITestConfiguration testConfiguration = project.TestConfigurations.Query("Select * from TestConfiguration WHERE Name='" + yourConfigurationName + "'")[0];
IDictionary<string, string> testConfigValues = testConfiguration.Values;
string browser = testConfigValues["Browser"];
string operatingSystem = testConfigValues["Operating System"];
}
我記得馬塞爾德弗里斯博客關於那...這是你在追求什麼? http://blogs.infosupport.com/switching-browser-in-codedui-or-selenium-tests-based-on-mtm-configuration/ – jessehouwing
謝謝@jessehouwing,我想從配置名稱的配置值,在這裏,我們可以得到配置,但如何獲得內部的值,因爲我必須同時設置操作系統和瀏覽器。 –