How to read parameter values ​​from TestCase in Microsoft Test Manager

I am trying to execute test programs programmatically using microsoft test manager using C #. To do this, I want to read the parameter values ​​stored in Microsoft Test Manager. Please suggest me how to do this For example: - read the value of the internal parameter "MY PRICE" I tried to enter an image, but it did not work ...

Relations Severe

+6
source share
2 answers

I assume that you want to read the parameters from a test case data source that your automatic test implements.

You must associate your test with the test case identifier in TFS.

Try using the following code.

[TestClass] public class TestClass { public TestContext TestContext { get; set; } public DataRow DataRow { get; set; } [TestMethod] [DataSource("Microsoft.VisualStudio.TestTools.DataSource.TestCase", "http://localhost:8080/tfs/[CollectionName];[ProjectName]", "[TestCaseId]", DataAccessMethod.Sequential)] public void TestMethod() { string column1 = TestContext.DataRow[0].ToString(); // read parameter by column index string column2 = TestContext.DataRow["Column2"].ToString(); //read parameter by column name } } 

Keep in mind that your TestMethod will run once for each row (iteration) of the Test Case data source.

+7
source

I think you are describing data encoding tests with data encoding.

http://msdn.microsoft.com/en-us/library/ee624082.aspx

0
source

Source: https://habr.com/ru/post/901690/


All Articles