TA的每日心情 | 郁闷 2014-10-28 14:43 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
关于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
|
|