user6522678
user6522678

Reputation:

Adding Bearer token in Web performance tool Visual Studio 2013 ultimate

I have recorded a site that I want to monitor its performance in Web Performance tool Visual Studio 2013. In my site for each request I am sending Bearer token. So, how can I add the bearer token in web performance tool or the recorder holds the Authorization header by default.

enter image description here I am very new to this tool and I searched many sites regarding this but I could not found the solution. Help me to get out of this problem.

Upvotes: 3

Views: 1433

Answers (1)

AdrianHHH
AdrianHHH

Reputation: 14038

From the context (right click) menu of the request that needs the token, select "Add header". Use the properties panel of the newly added header to set the required name and value of the token.

If the same header field is required on more than one request you can copy the whole header entry and paste it into another request. (The copy and paste commands are not fully implemented across web tests. In some places the Control-C and Control-V commands work, in other places context menu copy and paste commands work, in others both styles work. Just do some experimenting.)

If the token is required in all of the requests and there are lots of requests in the web test it may be easier to create a WebTestPlugin and set the header in the PreRequest method. Use a statement based on:

e.Request.Headers.Add("the header field's name", "and it's value")

Upvotes: 4

Related Questions