0

I'm not quite sure how to proceed. I have an ASP.NET MVC 5 web application that has identifiers in the URL as in the following:

/Controller/Action/XX0000001X/123456

Where XX0000001X and 123456 are identifiers to the record. Now, what I need to have happen is the web performance test not hard-code these in the test itself, because the next time it runs it will cause an issue, since these are generated everytime.

Is there a way to allow any value in the URL within Visual Studio web performance test?

Tushar Kulkarni
  • 323
  • 4
  • 19
Brian Mains
  • 50,520
  • 35
  • 148
  • 257
  • See http://stackoverflow.com/questions/23649732/how-to-use-a-list-of-values-for-a-parameter/23673194#23673194 , additionally rather than data driving you may want to use extraction rules to get the variable part of the URL. Then use something like `/Controller/Action/{{CP1}}/{{CP2}}` in the URL field - note the doubled curly braces. – AdrianHHH Jun 01 '15 at 16:22
  • That's actually very useful and great to know, but the only problem is I can't data drive it because the values are not determined by the user, but the system. Thus, I'd have to be able to pre-arrange the values, which is something I cannot do......... I need to allow the application system to do the data driving for me....... – Brian Mains Jun 01 '15 at 16:28

1 Answers1

0

Some ways of getting the values are:

  1. You just know the values. So embed them in the URL, or save them in context parameters. Eg setting CP1 to XX0000001X and CP2 to 123456.

  2. The values are provided in earlier responses. Use an extraction rule to get each value. Probably need two rules, saving to CP1 and CP2 There are several built-in rules but writing your own extraction rule is possible for more complex cases.

  3. Several sets of values are known in advance of the test and each set of values should be used in one test. Data drive with these vales. See How to use a list of values for a parameter? for more details.

  4. Some other code, perhaps in a plugin, generates the values and saves them to context parameters CP1 and CP2.

Having got the required values in context parameters just use them in the url. Set the url (or part of it) to be

Controller/Action/{{CP1}/{{CP2}}

Or, if the values come from a data source then the url should be in the style

Controller/Action/{{DataSource1.FileName#csv.FirstField}}/{{DataSource1.FileName#csv.SecondField}}
Community
  • 1
  • 1
AdrianHHH
  • 13,492
  • 16
  • 50
  • 87