How to read xml attachment from TFS test case to Test method?

▼魔方 西西 提交于 2019-12-13 07:08:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!