简体   繁体   English

加载和自动化SVC Web服务自动测试

[英]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. 我刚刚用5种方法完成了Web Service( .SCV ),并且通过使用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). 为了确保所有方法的性能和稳定性,我想通过使用Microsoft Web Performance和 Visual Studio 2013(最终版)进行负载测试来进行一些压力和负载测试。 looking on the web the step to follow i found this tutorial 在网上寻找要遵循的步骤,我找到了本教程

By submitting Xml Request of my first simple GetData() Method 通过提交我的第一个简单GetData()方法的Xml请求

*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. Web性能测试可以两种形式保存:xml文件或ac#代码文件。 The tutorial in your link looks to be saving the tests as an XML file. 您链接中的教程似乎将测试另存为XML文件。 Each form of the test has its own way of extracting the response. 每种形式的测试都有其提取响应的方式。

XML tests XML测试

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. 您仅限于定义请求并从Visual Studio Webtest库中选择文本提取或验证规则以针对响应运行。

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. 您可以通过引用URL或标题字符串中大括号{parameter_name}中的{parameter_name}来访问后续请求中的提取文本。

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. 您可以通过编程方式定义IEnumerator块来发送请求。 Within this block you can do anything in C#.NET. 在此块内,您可以在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. 您可以附加与测试XML形式相同的文本和验证规则,但是还可以选择访问WebTestResponse对象,该对象包含先前的响应URI,标头和正文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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