Accept-Encoding:跟压缩有关,浏览器发送http请求给web服务器,http请求中的header有Accept-Encoding:gzip,deflate(告诉服务器,浏览器支持gzip压缩) Content-Length:发送给HTTP服务器数据的长度。 Content-Type:即是Internet Media Type,互联网媒体类型;也叫做MIME类型,在Http协议消息头中,使用Content-Type来表示具体请求中的媒体类型信息。 例如:Content-Type: application/x-www-form-urlencoded 常见的媒体格式类型如下: text/html : HTML格式 text/plain :纯文本格式 text/xml : XML格式 image/gif :gif图片格式 image/jpeg :jpg图片格式 image/png:png图片格式 以application开头的媒体格式类型: application/xhtml+xml :XHTML格式 application/xml : XML数据格式 application/atom+xml :Atom XML聚合格式 application/json : JSON数据格式 application/pdf :pdf格式 application/msword : Word文档格式 application/octet-stream : 二进制流数据(如常见的文件下载) application/x-www-form-urlencoded : <form encType=””>中默认的encType,form表单数据被编码为key/value格式发送到服务器(表单默认的提交数据的格式) 另外一种常见的媒体格式是上传文件之时使用的: multipart/form-data : 需要在表单中进行文件上传时,就需要使用该格式
注意:gzip、compress以及deflate编码都是无损压缩算法,用于减少文件传输大小,不会导致信息丢失,其中gzip效率最高,使用最广。
HTTP/1.1 200 OK Date: Mon, 30 Dec 2019 11:16:45 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive Vary: Accept-Encoding Content-Length: 19121 <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="referrer" content="never" /> <meta property="og:description" content="一、soapUI简介 soapUI是一个开源测试工具,通过soap/http来检查、调用、实现Web Service的功能/负载/符合性测试。该工具既可作为一个单独的测试软件使用,也可利用插件集成到E" /> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>接口测试工具soapUI(一) - 帅姐 - 博客园</title> <link rel="stylesheet" href="/css/blog-common.min.css?v=PyyhYDRKBG1sYtpoHme_xHO5AMd5iN57I45iBKF8FVY" /> <link id="MainCss" rel="stylesheet" href="/skins/summergarden/bundle-summergarden.min.css?v=X4bFXeVITa4R62KibBcxY9PyNj-MkkV0-IpC8y8yg_Q" /> <link id="mobile-style" media="only screen and (max- 767px)" type="text/css" rel="stylesheet" href="/skins/summergarden/bundle-summergarden-mobile.min.css?v=-QJralHuYdZVDw2zivi4j5fUWp9jAHwpSH6TIdmjbwI" /> <link type="application/rss+xml" rel="alternate" href="https://www.cnblogs.com/shuaijie/rss" /> <link type="application/rsd+xml" rel="EditURI" href="https://www.cnblogs.com/shuaijie/rsd.xml" /> <link type="application/wlwmanifest+xml" rel="wlwmanifest" href="https://www.cnblogs.com/shuaijie/wlwmanifest.xml" /> <script src="https://common.cnblogs.com/scripts/jquery-2.2.0.min.js"></script> <script src="/js/blog-common.min.js?v=9AUvV7CGRXeBxRXvxWjIJxJZemektvGlJfH8yBiYzRQ"></script> <script> var currentBlogId = 162206; var currentBlogApp = 'shuaijie'; var cb_enable_mathjax = false; var isLogined = true; </script> </head> <body> <a name="top"></a> <!--done--> <div id="home"> <div id="header"> <div id="blogTitle"> <a href="https://www.cnblogs.com/shuaijie/"><img id="blogLogo" src="/skins/custom/images/logo.gif" alt="返回主页" /></a> <!--done--> <h1><a id="Header1_HeaderTitle" class="headermaintitle HeaderMainTitle" href="https://www.cnblogs.com/shuaijie/">架海擎天</a> </h1> <h2> 越来越好的前提就是越来越努力! </h2> </div><!--end: blogTitle 博客的标题和副标题 --> <div id="navigator"> <ul id="navList"> <li><a id="blog_nav_sitehome" class="menu" href="https://www.cnblogs.com/"> 博客园</a> </li> <li> <a id="blog_nav_myhome" class="menu" href="https://www.cnblogs.com/shuaijie/"> 首页</a> </li> <li> <a id="blog_nav_newpost" class="menu" href="https://i.cnblogs.com/EditPosts.aspx?opt=1"> 新随笔</a> </li> <li> <a id="blog_nav_contact" class="menu" href="https://msg.cnblogs.com/send/%E5%B8%85%E5%A7%90"> 联系</a></li> <li> <a id="blog_nav_admin" class="menu" href="https://i.cnblogs.com/"> 管理</a> </li> <li> <a id="blog_nav_rss" class="menu" href="https://www.cnblogs.com/shuaijie/rss/"> 订阅</a> <a id="blog_nav_rss_image" href="https://www.cnblogs.com/shuaijie/rss/"> <img src="/skins/summergarden/images/xml.gif" alt="订阅" /> </a></li> </ul> <div class="blogStats"> <!--done--> 随笔 - 2 文章 - 39 评论 - 12 </div><!--end: blogStats --> </div><!--end: navigator 博客导航栏 --> </div><!--end: header 头部 --> <div id="main"> <div id="mainContent"> <div class="forFlow"> <div id="post_detail"> <!--done--> <div id="topics"> <div class="post"> <h1 class = "postTitle"> <a id="cb_post_title_url" class="postTitle2" href="https://www.cnblogs.com/shuaijie/articles/5913750.html">接口测试工具soapUI(一)</a> </h1> <div class="clear"></div> <div class="postBody"> <div id="cnblogs_post_body" class="blogpost-body "> <h3><span style="color: #ff0000; background-color: #ffffff;">一、soapUI简介</span></h3> <p> soapUI是一个开源测试工具,通过soap/http来检查、调用、实现Web Service的功能/负载/符合性测试。该工具既可作为一个单独的测试软件使用,也可利用<a href="http://baike.so.com/doc/1483288-1568456.html" target="_blank">插件</a>集成到Eclipse,maven2.X,Netbeans 和intellij中使用。soapUI pro是soapUI的商业非开源版本,实现的功能较开源的soapUI更多。</p> <h3><span style="color: #ff0000;">二、soapUI初体验</span></h3> <h4>1、soapUI安装及破解(参考:http://blog.csdn.net/liuchangxin1982/article/details/47614625)</h4> <p>1)安装方法</p> <p>先下载SOAPUI,我这里用的是5.1.2 PRO 版</p> <p>下载路径:<a href="http://dl.eviware.com/list_soapui2.html?_ga=1.16http://dl.eviware.com/list_soapui2.html?_ga=1.162568764.18578086.14016161482568764.18578086.1401616148" target="_blank">http://dl.eviware.com/list_soapui2.html?_ga=1.16http://dl.eviware.com/list_soapui2.html?_ga=1.162568764.18578086.14016161482568764.18578086.1401616148</a></p> <p><img src="http://img.blog.csdn.net/20150813163135699?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p>双击安装文件</p> <p><img src="http://img.blog.csdn.net/20150813163317254?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p> </p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813163421255?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813163435703?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813163447891?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813163500493?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813163514443?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813163528381?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813163540270?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813163723434?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813163731157?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> 安装之后需要破解才能用</p> <p>2)破解方法:http://blog.csdn.net/liuchangxin1982/article/details/47614899</p> <p>关掉SOAPUI 界面</p> <p> </p> <p>先将C:\Program Files\SmartBear\SoapUI-Pro-5.1.2\lib\Protection-4.6.jar 删除</p> <p>之后用破解文件中的Protection-4.6.jar 去替换</p> <p>出现如下画面先按取消</p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813164224046?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813164234918?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p> </p> <p><img src="http://img.blog.csdn.net/20150813164250651?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813164259945?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /><img src="http://img.blog.csdn.net/20150813164309573?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813164328795?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p><img src="http://img.blog.csdn.net/20150813164345547?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></p> <p>出现这种界面说明破解成功</p> <h4>2、soapUI界面介绍</h4> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927165639922-798461775.png" alt="" /></p> <h4>3、创建项目</h4> <p>这里创建REST服务</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927165855156-1967883419.png" alt="" /> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927170054360-371416171.png" alt="" /></p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927170302797-717584330.png" alt="" /></p> <h3><span style="color: #ff0000;">三、soapUI测试用例</span></h3> <h4>1、测试数据单一</h4> <p>1)新建测试套件:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927170439313-1185638577.png" alt="" /> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927170541766-959494907.png" alt="" /></p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927170707844-715112230.png" alt="" /></p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927170737219-1968722277.png" alt="" /></p> <p>增加断言:</p> <p> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927171322797-150400508.png" alt="" /></p> <p> </p> <p> </p> <p> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927171031219-1530222310.png" alt="" /></p> <p>运行结果:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927171405672-326372155.png" alt="" /></p> <h4>2、测试数据来源于excel:(参考:http://www.cnblogs.com/heiyexiaoguai/p/4852334.html)</h4> <p>1)创建测试数据文件:testaccept.xlsx</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927171640313-1618979686.png" alt="" /></p> <p>2)选择测试步骤,添加【Datasource】</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927171944453-1516662363.png" alt="" /></p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927172015797-1396747397.png" alt="" /></p> <p>3)添加请求:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927172859531-1306119233.png" alt="" /></p> <p> </p> <p>4)添加DataSource Loop,又来控制循环取数</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173011188-1271496895.png" alt="" /> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173041625-846870630.png" alt="" /></p> <p>5)增加断言:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173123563-896783351.png" alt="" /><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173147281-807450919.png" alt="" /></p> <p>6)运行结果</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173359703-1058437145.png" alt="" /></p> <p> </p> <p>我们看到测试用例执行失败后,后面的将不会执行,而我们希望即使失败也要执行所有的测试用例,我们做如下设置:取消Abor test if an fasiled TestSteps前面的钩,再运行:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173531047-159260860.png" alt="" /> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173600219-547064147.png" alt="" /></p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173744891-1983102051.png" alt="" /></p> <p>7)查看测试结果信息:<img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927173830250-406988099.png" alt="" /></p> <p>8)导出测试报告</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927174316766-1741821213.png" alt="" /></p> <p> </p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160927174250438-1751389417.png" alt="" /></p> <h3><span style="color: #ff0000;"> 四、soapUI性能测试</span></h3> <p><span style="color: #ff0000;"><span style="color: #000000;">1、创建性能测试用例:</span><br /></span></p> <p><span style="color: #ff0000;"><span style="color: #000000;"><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160928084227500-673632399.png" alt="" /> <img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160928084249110-1388723561.png" alt="" /></span></span></p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160928084311438-1084683055.png" alt="" /></p> <p>2)点击运行,运行结果如下:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160928084555547-382052013.png" alt="" /></p> <p>3)参数设置说明:</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160928084727703-2055717051.png" alt="" /></p> <p>4)生成性能测试统计图</p> <p><img src="https://images2015.cnblogs.com/blog/563728/201609/563728-20160928084853906-684640686.png" alt="" /></p> <p> </p> </div> <div id="MySignature"></div> <div class="clear"></div> <div id="blog_post_info_block"> <div id="blog_post_info"></div> <div class="clear"></div> <div id="post_next_prev"></div> </div> </div> <div class="postDesc">posted @ <span id="post-date">2016-09-27 17:46</span> <a href="https://www.cnblogs.com/shuaijie/">帅姐</a> 阅读(<span id="post_view_count">...</span>) 评论(<span id="post_comment_count">...</span>) <a href="https://i.cnblogs.com/EditArticles.aspx?postid=5913750" rel="nofollow">编辑</a> <a href="javascript:void(0)" onclick="AddToWz(5913750);return false;">收藏</a></div> </div> </div> <script src="https://common.cnblogs.com/highlight/9.12.0/highlight.min.js"></script> <script>markdown_highlight();</script> <script> var allowComments = true, cb_blogId = 162206, cb_blogApp = 'shuaijie', cb_blogUserGuid = '025de365-9813-e311-8d02-90b11c0b17d6'; var cb_entryId = 5913750, cb_entryCreatedDate = '2016-09-27 17:46', cb_postType = 2; loadViewCount(cb_entryId); </script><a name="!comments"></a> <div id="blog-comments-placeholder"></div> <script> var commentManager = new blogCommentManager(); commentManager.renderComments(0); </script> <div id="comment_form" class="commentform"> <a name="commentform"></a> <div id="divCommentShow"></div> <div id="comment_nav"><span id="span_refresh_tips"></span><a href="javascript:void(0);" onclick="return RefreshCommentList();" id="lnk_RefreshComments" runat="server" clientidmode="Static">刷新评论</a><a href="#" onclick="return RefreshPage();">刷新页面</a><a href="#top">返回顶部</a></div> <div id="comment_form_container"></div> <div class="ad_text_commentbox" id="ad_text_under_commentbox"></div> <div id="ad_t2"></div> <div id="opt_under_post"></div> <script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script> <script> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; </script> <script> googletag.cmd.push(function () { googletag.defineSlot("/1090369/C1", [300, 250], "div-gpt-ad-1546353474406-0").addService(googletag.pubads()); googletag.defineSlot("/1090369/C2", [468, 60], "div-gpt-ad-1539008685004-0").addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.enableServices(); }); </script> <div id="cnblogs_c1" class="c_ad_block"> <div id="div-gpt-ad-1546353474406-0" style="height:250px; 300px;"></div> </div> <div id="under_post_news"></div> <div id="cnblogs_c2" class="c_ad_block"> <div id="div-gpt-ad-1539008685004-0" style="height:60px; 468px;"> <script> if (new Date() >= new Date(2018, 9, 13)) { googletag.cmd.push(function () { googletag.display("div-gpt-ad-1539008685004-0"); }); } </script> </div> </div> <div id="under_post_kb"></div> <div id="HistoryToday" class="c_ad_block"></div> <script type="text/javascript"> fixPostBody(); setTimeout(function () { incrementViewCount(cb_entryId); }, 50); deliverAdT2(); deliverAdC1(); deliverAdC2(); loadNewsAndKb(); loadBlogSignature(); LoadPostCategoriesTags(cb_blogId, cb_entryId); LoadPostInfoBlock(cb_blogId, cb_entryId, cb_blogApp, cb_blogUserGuid); GetPrevNextPost(cb_entryId, cb_blogId, cb_entryCreatedDate, cb_postType); loadOptUnderPost(); GetHistoryToday(cb_blogId, cb_blogApp, cb_entryCreatedDate); </script> </div></div> </div><!--end: forFlow --> </div><!--end: mainContent 主体内容容器--> <div id="sideBar"> <div id="sideBarMain"> <div id="sidebar_news" class="newsItem"> <script>loadBlogNews();</script> </div> <div id="calendar"><div id="calendar"><div id="blog-calendar" style="display:none"></div></div> <script>loadBlogDefaultCalendar();</script></div> <DIV id="leftcontentcontainer"> <div id="blog-sidecolumn"></div> <script>loadBlogSideColumn();</script> </DIV> </div><!--end: sideBarMain --> </div><!--end: sideBar 侧边栏容器 --> <div class="clear"></div> </div><!--end: main --> <div class="clear"></div> <div id="footer"> <!--done--> Copyright © 2019 帅姐 <br /><span id="poweredby">Powered by .NET Core 3.1.0 on Linux</span> </div><!--end: footer --> </div><!--end: home 自定义的最大容器 --> </body> </html>