用selenium进行集成测试

按照常规做法,集成测试应该由测试部的测试人员来做,然而大对于中小公司来说可能成本太高。所以这个工作就要有开发人员来做了 。做开发也不容易啊 :(
而thougtworks开发的selenium就是为开发人员度身定制的一个集成测试工具
闲话不多说 下面就开始我们的配置工作
1.下载selenium-core包:[url]http://www.openqa.org/selenium-core/[/url]最近版本是0.8.3
2.解压后有几个目录:core tests jsunit等,拷贝core tests到应用根目录下,打开测试主页http://localhost:8080/showradio/core/TestRunner.html,这就是selenium的控制台,点击左侧的‘GO’按钮,运行测试用例 出现的是selenium自带的一些测试用例的结果
至此配置完成。
下一步开始定义测试用例,
myTest.html
[code] <table cellpadding="1" cellspacing="1" border="1">
<tbody>
<tr>
<td rowspan="1" colspan="3">测试首页<br>
</td>
</tr>
<tr>
<td>open</td>
<td>/showradio/index.jsp</td>
<td> </td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td></td>
<td>秀radio 中国第一网络电台</td>
</tr>

</tbody>
</table>[/code]
open 是selenium的一条指令 打开页面/showradio/index.jsp
verifyTextPresent也是指令 检验页面是否存在指定文本
了解指令请参考 [url]http://wiki.springside.org.cn/display/springside/Selenium+Reference[/url]
把myTest。html添加到 tests/TestSuit.html中
[code]<tr><td><a href="./showradio/TestIndex.html">我的测试</a></td></tr>[/code]
点击http://localhost:8080/showradio/core/TestRunner.html页面的 GO 按钮
进入测试用例列表页, 点击右侧的execute tests 运行测试。
具体用法请参考官网 [code]http://www.openqa.org/selenium-core/usage.html[/code]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值