开发者

Generic VSTS loadtest

开发者 https://www.devze.com 2023-04-01 20:27 出处:网络
I have a bunch of vsts loadtests for diffrent needs.Most of them are goal based tests targeting CPU and ASP.Net requests counters on a machine. The machine name is hardcoded on these loadtests and my

I have a bunch of vsts loadtests for diffrent needs.Most of them are goal based tests targeting CPU and ASP.Net requests counters on a machine. The machine name is hardcoded on these loadtests and my requirement is I need to run these tests on diffrent machines. So each time a machine name changes I开发者_C百科 have to update at multiple places. Is there a way pickup the values from a config. Something like I specify the machine name in app.config and all the load tests pickup the value from the same location.I'am sure there should be an way to do this.


From http://msdn.microsoft.com/en-us/library/ff406971.aspx:

You can create context parameters to use in a load test run setting by using the Load Test Editor. Context parameters let you parameterize a string. Suppose your load test contains a Web performance test that already uses a parameterized Web server URL by using a context parameter. You can add a context parameter to a load test run setting that uses the same name value as the one that is used in the Web performance test. This will map the Web performance test to a different server when you run the load test.

The reference to the web performance test brings you at: http://msdn.microsoft.com/en-us/library/ms184806.aspx:

You can parameterize the URL for your Web server. The purpose of parameterization is to make it easy to change the Web server that your tests target. A test, either recorded or coded, can run against various servers. When you use parameterization, you can easily change servers by re-mapping the Web server context parameter to another server. You do not have to re-record or re-write the test.

This is useful when, for example, you want to run tests on a Web server that has one name in your non-production environment and another name in your production environment. In this case, both the Web servers are active Web servers.

So it is possible to parameterize your web server address and you can reuse that parameter when doing load tests. Please visit the linked documentation for more details on how to actually parameterize the webserver address.

Should be working ...

0

精彩评论

暂无评论...
验证码 换一张
取 消