Prevent Visual Studio Web Test from changing request details
- by keithwarren7
I have a service that accepts Xmla queries for Analysis services, often times those queries themselves will have a string that contains a fragment that looks something like
{{[Time].[Year].[All]}}
Recording these requests works fine but when I try to re-run the test I get an error from the test runner...
Request failed: Exception occurred: There is no context parameter with the name ' [Time].[Year].[All]' in the WebTestContext
This was confusing for some time but when I asked VS to generate a coded version of the test I was able to see the problem a bit better. VS searches for the '{{' and '}}' tokens and makes changes, considering those areas to refer to Context parameters, the code looks like
this.Context["\n\t[Time].[Year].[All]"].ToString()
Anyone know how to instruct Visual Studio to not perform this replacement operation? Or another way around this issue?