8

I am starting out with Visual Studio 2012, and have been tasked with writing some load tests that hit REST services. Struggling because I'd like to parameterize a value that's in the URL, accessing a .csv file as a datasource.

For example, I'd like the URL to be http://staging.company.com/OrderService.svc/GetOrderInfo/{{OrderId}}

...and use a .csv file to iterate through a list of OrderId's.

There's a lot of info online about parameterizing values in the body of a request, and I've went through "Binding a Data Source to a Web Performance Test" here: http://msdn.microsoft.com/en-us/library/ms404707.aspx.

Am I just missing something obvious, or is there no way to do this?

Thanks.

2
  • what is your problem : an error in the binding ? you don't know how to do ? ... Commented Jan 7, 2013 at 11:11
  • Hey- after you got your test to work, were you able to aggregate the results for the service? Or, did you have to deal with results for each OrderId? (My thought is yes, it's a different url but it's the same page/function) -- hopefully this makes ense Commented Jun 11, 2013 at 23:14

1 Answer 1

6

You are on the right path but for an obscure reason you can't bind context parameters to a datasource. Your only solution is to put the binding expression in the url like that :

 http://staging.company.com/OrderService.svc/GetOrderInfo/{{MyDataSource.MyTestData#csv.column1}} 
Sign up to request clarification or add additional context in comments.

1 Comment

for xml datasource, this is a sample url: /Receipt/{{XmlDataSource.item.receiptNumber}} where the XML looks like: <?xml version="1.0" encoding="utf-8" ?> <items> <item> <receiptNumber>2293086</receiptNumber> </item> <item> <receiptNumber>2293087</receiptNumber> </item> <item> <receiptNumber>2293088</receiptNumber> </item> </items>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.