问题
We have test cases in TFS. I would like to pass test parameters in xml file to each test cases.So for that we have an 'attachment' option in each and every test case in TFS. Now how to read that xml file into our test method and make each test case automated in MTM(Microsoft test manager). Is this possible?
回答1:
Unfortunately, it is not supported to get parameter values from workitem attachments directly in MTM.
The attachment in TFS test case could be reached using an url: http://SERVERNAME:8080/tfs/MyCollection/_apis/wit/attachments/e14b962c-b8bc-4e3e-b4f8-398a89c08522
. The e14b962c-b8bc-4e3e-b4f8-398a89c08522
is the attachment GUID. But When this below, it does not support to do so.
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML","http://v-tinmo-12r2:8080/tfs/MyCollection/_apis/wit/attachments/{attachmentId},"Row",DataAccessMethod.Sequential)]
Here is an user voice that you could vote about your request: https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/18643267-get-test-parameter-value-from-test-case-attachment
来源:https://stackoverflow.com/questions/42827835/how-to-read-xml-attachment-from-tfs-test-case-to-test-method