简体   繁体   中英

Load and automate SVC Web Service auto Testing

I have just finished a web Service( .SCV ) with 5 methods and it's running with out any problem by using WCFTestClient. I successfully invoked all methods with the right expected result.

In order to insure of performance and stability of all methods, i'd like to make some stress and load test by using the Microsoft Web Performance and load testing with visual studio 2013 (Ultimate edition). looking on the web the step to follow i found this tutorial

By submitting Xml Request of my first simple GetData() Method

*whitch look like :* 
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetData xmlns="MyWebService" />
  </s:Body>
</s:Envelope>  

unfortunately still not understand how to get the result of this method. maybe i missed some setting or parameters. Some help or some link will be nice. Thank you

The web performance test can be saved in two forms: an xml file or ac# code file. The tutorial in your link looks to be saving the tests as an XML file. Each form of the test has its own way of extracting the response.

XML tests

This takes a higher level view. You supply a list of requests and the test runner will run down the list, send off each request and capture its response. You're limited to defining requests and picking a text extraction or validation rule from the Visual Studio webtest library to run against a response.

With the text extraction rule you specify the name of a parameter to bind to the extracted text. You can access the extracted text in subsequent requests by referring to the parameter in curly braces {parameter_name} in the URL or header string.

The validation rule will run the specified predicate against the response and mark the test as passed or failed.

Coded tests

This form takes a lower level view. You programmatically define an IEnumerator block to send out requests. Within this block you can do anything in C#.NET.

You can attach the same text and validation rules as the XML form of the test, but also have the option of accessing the WebTestResponse object that contains the previous response URI, headers and body.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM