0

I am trying to add VSTS(Visual Studio Team Services) path as DataSource attribute for one of my test method in CodedUI solution.

[DataSource("Microsoft.VisualStudio.TestTools.DataSource.TestCase",
   "https://<name>.visualstudio.com/<project>;<teamname>", "<id>", DataAccessMethod.Sequential), TestMethod]

This code was working fine on TFS But when i am executing the method now, i am getting the below exception : TF30063: You are not authorized to access : https://<name>.microsoft.visualstudio.com Previously also i got the same exception in one of my web apps and there i added PAT based authentication to resolve the issue. Now is there any way i can authenticate in DataSource attribute ?

G.S Abhaypal
  • 362
  • 1
  • 6
  • 17

1 Answers1

0

No, there isn’t the way to specify authentication information with VSTS test case source.

Refer to these steps to deal with this issue:

  1. Open VS 2015 and open Team Explorer
  2. Click Manage Connections >Connect to Team project
  3. Click Server > Add
  4. Type your VSTS address
  5. Connect to that team project with the account that can access that test case work item
  6. Open your test project in VS and run test

If you are running test on build, you can setup a on premise build agent with integrative mode. (You need to refer to above steps to log on to your build agent and connect to VSTS in team explorer)

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • i am already working on Git, Connection is already made to my VSTS project, still not able to connect. Please refer another thread which i posted after this. http://stackoverflow.com/questions/42531135/tf400813-resource-not-available-for-anonymous-access-client-authentication-req – G.S Abhaypal Mar 03 '17 at 08:52
  • @G.SAbhaypal Do you run test in VS or TFS build? If you do test in build, the build agent need to be running as integrative mode. – starian chen-MSFT Mar 03 '17 at 09:50