51Testing软件测试论坛

标题: 利用QTP进行webservice进行附件上传,无法成功 [打印本页]

作者: 我叫板凳    时间: 2014-10-28 14:42
标题: 利用QTP进行webservice进行附件上传,无法成功

关于QTP9.2测试webservice进行附件上传无法成功,已经参考了帮助,但是仍无法成功,请大神们帮助

Add Attachments for the Next Web Service Operation CallSub Attachments_Example()


'The following example adds two attachments for use with the next WebService operation

'call, then retrieves the temporary location where QuickTest has stored the attachments

'and prints these locations in a message box.



WebService("CheckAttachmentsLocalhostServi").AddAttachment "c:\temp.xml" ' Send temp.xml as an attachment of the toolkit default type with the next call to the Web service

WebService("CheckAttachmentsLocalhostServi").AddAttachment "c:\temp.exe" ' Send temp.exe as an attachment of the toolkit default type with the next call to the Web service

WebService("CheckAttachmentsLocalhostServi").CheckAttachmentsInfo True, 1 ' This call to the Web service will send existing attachments to the service and send them back after 1 second

注,上边的代码无法执行,总报错,说没有CheckAttachmentsInfo的方法


arrAttachments = WebService("CheckAttachmentsLocalhostServi").GetAttachments ' Get an array of file locations for attachments receieved with the last Web service call

For Iterator = 0 To UBound(arrAttachments)

    MsgBox arrAttachments(Iterator) ' print the location of the attachment file, should be in %temp% directory

Next


End Sub

作者: 赵佳乐SMILE    时间: 2014-10-29 09:56
高大上 没用过




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2