【软件测试自动化-QTP NOTE 12】 == Web Services-Final==

 

想必大家都知道QTP Addin的成本之高,所以如何避免使用付费Addin来测试需求对象是解决成本的最佳方案。

面对WebService,我们可以用到 WinHTTP协议(微软windows HTTP服务),这是一个非常高级别的HTTP协议接口。

以下会具体介绍下这个COM对象。

 

1.创建WinHttp对象

 

 
2.如果你在VBEdit中创建后,会自动加载这个对象的所有Method
WinHttp
3.具体介绍下对象的不同属性和其Methods

Object.Open Method,URL,Async
Open – opens a connection to an HTTP resource.
Method – specifies the HTTP verb used for the open method, like ‘GET’,’PUT’,’POST’ etc
URL – the name of the resource
Async – indicates whether to open in asynchronous mode.

Object.SetRequestHeader Header,Value
SetRequestHeader – adds, changes, or deletes an HTTP request header
Header- Specifies the name of the header to be set like depth,Content type, Content length etc.
Value-specified the value of header.

Object.Send Body 
Send – sends an HTTP request to an HTTP server.
Body – is the data to be sent to the server.


 

运行以上脚本,最终会返回 77

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值