0
votes

I saw some test code using data driven test approach to read the test data from VSTS work item with following like code:

[DataSource("Microsoft.VisualStudio.TestTools.DataSource.TestCase", "https://myaccount.visualstudio.com/DefaultCollection;XXX", "11543012", DataAccessMethod.Sequential)]

I tried this approach also in my code, but got following like error: The unit test adapter failed to connect to the data source or to read the data. Error details: TF26198: The work item does not exist, or you do not have permission to access it.

I am wondering what is the underlying mechanism of Data Source connection to VSTS work item? How does my code connect to VSTS work item? What credential it uses to access work item?

1

1 Answers

0
votes

It uses cache credential of team explorer. Log on test/build with the same account of test agent/build agent, then connect to your VSTS through Team Explorer, then queue build/release to do test.

Note, if you are using Visual Studio Test task, the test is running on build agent, if you are using Run Functional Test, the test is running on test agent.