【发布时间】:2018-01-23 23:33:06
【问题描述】:
这里是例子 add.robot 文件
*** Settings ***
Library SudsLibrary
Library XML
Library String
*** Test Cases ***
Test Webservice
create Soap Client http://www.dneonline.com/calculator.asmx?wsdl
${add} Create Wsdl Object Add
${add.intA} Set Variable 3
${add.intB} Set Variable 4
# # call soap web service
call soap method Add ${Add}
${soap_response} Get Last Received
log to console ${soap_response}
${XML_object}= Parse XML ${soap_response}
log ${XML_object}
${result} get element text ${XML_object} .//AddResult
set global variable ${result}
substract.robot 文件
试图在此文件中使用结果变量,但显示错误。 两个文件都存在于同一个文件夹中
*** Settings ***
Library SudsLibrary
Library XML
Library String
*** Test Cases ***
Test Webservice
create Soap Client http://www.dneonline.com/calculator.asmx?wsdl
${subs} Create Wsdl Object Subtract
${subs.intA} Set Variable ${result} #shows error
${subs.intB} Set Variable 4
# # call soap web service
call soap method Subtract ${subs}
${soap_response} Get Last Received
log to console ${soap_response}
${XML_object}= Parse XML ${soap_response}
log ${XML_object}
${result11}= get element text ${XML_object} .//SubtractResult
【问题讨论】:
-
请看修改后的例子