您的位置:首页 > 产品设计 > UI/UE

SoapUI的使用2——模拟客户端

2016-07-13 19:39 435 查看
一、SoapUI的项目管理层次

SoapUI和项目对应关系图如下:



二、新建测试项目的步骤
1、新建命名空间



2、新建项目

3、添加WSDL(以WSDL为例)



4、新建测试集



5、新建测试用例



6、新建测试步骤



7、填写请求报文并提交



三、功能测试技巧

1、属性的使用

(1)、新建属性

属性窗口中的Custom Properties属性设置允许用户自定义属性。以project属性为例:



加号用来添加新属性,每个属性都有名字和值。新增的自定义属性会在自定义属性列表中显示。

(2)、引用属性

比如可以在请求报文中、脚本中引用属性。例如:引用位置处右键菜单->GetData->属性。



这样运行时引用属性的地方会自动得到属性的值。

2、Assertion的使用

测试用例设计好后,我们需要通过预期值与执行结果对比,来判定是否pass,Assertion就用来作为我们结果的判断。

四、Q&A

1、现象:启动服务后,在soapUI中发送请求报文,应答消息为:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Connection to server failed</title>
<style type="text/css">
<!--
body {
font-family: sans-serif;
padding: 1em;
}
.mainBody {
max-width: 600px;
margin: auto;
}
.header {
border-bottom: 3px solid #e73a27;
line-height: 1.5em;
padding-bottom: 1em;
}
h1 {
color: #808080;
font-size: 1.5em;
line-height: 1em;
}
span {
color: #000000;
font-size: 1em;
}
.footer {
text-align: right;
padding-top: 3px;
color: #808080;
font-weight: bold;
}
.footer i {
font-style: normal;
}
.nocss {
display: none;
}
-->
</style>
</head>
<body>
<div class="mainBody">
<div class="header">
<h1>Connection to server failed</h1>
<span>Connection actively refused by the server</span>
</div>
<div class="footer"><span class='nocss'><br /></span><i>This message was created by Kerio Control Proxy</i></div>
</div>
</body>
</html>新建SoapUI项目,复制URL到Initial WSDL中,提示如下错误:



解决:参看:https://stackoverflow.com/questions/16981902/soap-parsing-wsdl-error-unexpected-element-tag-end/16981963

发生这种错误,除了URL本身的问题,其他很可能是SoapUI所在本机的网络代理问题,如果本机设置了代理,可以通过如下方式在SoapUI中不使用代理:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: