机器人框架 - 肥皂请求 - 变量

时间:2018-05-30 15:34:04

标签: soap robotframework

  • 我在机器人框架中的soap请求(下面的代码段)中有一个json数据,当我使用一个变量时 - 它没有得到解决 - 我已经大胆地使用了请求中使用的变量。我尝试使用{TRANSACTIONID}和{“TRANSACTIONID”}但是没有用。任何人都可以让我知道。感谢您的帮助!!感谢

这是机器人框架请求:

Send Start Request
[Arguments]  ${abc}  ${abc1}  ${abc2}  ${abc3}  
${start_request}
sleep    ${Delay}
Wait Until Keyword Succeeds  2 min  10 sec  Create Soap Client  & 
{login_details}[url]/soap/v1/CentralSystemService16Soap12?wsdl
sleep    ${Delay}
${message}=  Create Raw Soap Message  ${str}
sleep    ${Delay} 
${soap_response}=  Wait Until Keyword Succeeds   2 min  10 sec  Call Soap 
Method  StartTransaction     ${message}
${transactionID}=  Get Wsdl Object Attribute  ${soap_response}  
transactionId
${ID}  Convert To String    ${transactionID}
Set Suite Variable  ${ID}

==

肥皂请求

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
xmlns:ns="urn://Ocpp/Cs/2015/10/"><soap:Header 
xmlns:wsa="http://www.w3.org/2005/08/addressing"><ns:data>{"transactionId": 
{TRANSACTIONID},"connectorId": 1,"mobileNumber": "+12323234345", 
"emailAddress": "xyz@gmail.com"}</ns:data></ns:dataTransferRequest> 
</soap:Body></soap:Envelope>

==

Soap Resonse

<ns:data>{&quot;transactionId&quot;:{&quot;TRANSACTIONID&quot;},&quot;} 
</ns:data>

0 个答案:

没有答案