How to create and run web testing in visual studio


Prepare your Environment:

--Download and install Visual Studio (enterprise version).

1. Open Visual studio to create a test project.

 Choose File > new > project select Web Performance and Load Testing Project, and then rename your project name and select a specified path.

New project view

2. Right click on WebTest and add a Web service Request.

Add a request

the request is created and with a default URL. Replace the URL with the URL of your app's page.  Here I will send a post request . You can change the request type and set the expected status code in Properties.


3. Add a header and edit Body, etc.

Add a header

Edit body if need

Edit Body

4. Run web test .

Run test

5. Analyze the results

Result

You can see the testing is run successfully, response status =200 OK ..... Then I  change the status to 201. that testing will be failed and show you details about the error.

Failed to run the test

Summary:

I start to learn about Visual studio,  I think that visual studio is not designed for API testing ,so that is not convenient to run API testing.
















最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,446评论 0 23
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 14,595评论 5 6
  • 回忆是件复杂的事情,妥协是希望的借口。 记忆是人生若只如初见,何事秋风悲画扇;记忆是与君初相识,犹识故人面;记忆像...
    二月木子禽阅读 3,229评论 0 0
  • 我是一只小小的巨蟹, 住在遥远的南天, 也许天生, 赋予了水星系的特征。 穿着坚硬的盔甲, 举着高高的夹钳, 遮住...
    伊凡轩阅读 1,170评论 0 0
  • 一个犯错了的人,让一个个身边爱着他/她的人代其付出代价后,才下定决心要为自己的过错赎罪。我们该怎么看这种情况呢。 ...
    Aoifa阅读 1,261评论 0 0