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