| || |
Load Testing with Authentication Tokens
I've just started to use Visual Studio for testing and have run into a bit of a brick wall. The site I am testing uses Authentication Tokens. So when I ran my web test back it failed because the token was hardcoded from when I recorded it.
I got around this by generating code and replacing the hardcoded token with the one taken from the response from the initial request for the token. This works when running the test. However my problem is when I create a load test.
I add the coded web test to the mix, but when I run it I get large amounts of HTTP errors. When checking these, they are all 'Invalid Token' errors. If I am running the test with 25 concurrent users does this mean that each one is receiving a different token?
Is there something I can change in the settings to get around this, I've messed around with iterations but so far I'm still stuck.
Re: Load Testing with Authentication Tokens
the general approach you took is correct, that is, you take the token from the last response and bind it to the current request, but going to coded may be more prone to logic issues which I am hoping is what is happening in your case. If possible, my advice for solving this would be to stay as a GUI webtest if at all possible:
If you are running 25 concurrent users, yes, each one will receive a different token if you handle this correctly.