Soap Robot框架中的SudsLibrary:get&;设置对象属性

Soap Robot框架中的SudsLibrary:get&;设置对象属性,soap,robotframework,suds,Soap,Robotframework,Suds,我正在与机器人框架的SudsLibrary合作。下面是我正在测试的Web服务的Rq/Rs。您还可以找到Robot框架信息和我对正在发生的事情的评论 请求 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://localhost/ABC/Services/Security/"> <soapenv:Header/> <soap

我正在与机器人框架的SudsLibrary合作。下面是我正在测试的Web服务的Rq/Rs。您还可以找到Robot框架信息和我对正在发生的事情的评论

请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://localhost/ABC/Services/Security/">
   <soapenv:Header/>
   <soapenv:Body>
      <sec:AuthUser>
         <sec:userName>MyAdmin</sec:userName>
         <sec:password>Password123</sec:password>
      </sec:AuthUser>
   </soapenv:Body>
</soapenv:Envelope>
在我调用SudsLibrary
Get Wsdl Object Attribute
关键字之前,在我的测试用例中,一切都是成功的。出现以下错误:
ValueError:Object必须是WSDL对象(suds.sudsobject.Object)
。当对象被创建并成功调用时,为什么会出现错误

当我打印出
${result}
变量时,它是
AuthVal
的值。但是,我希望从web服务响应中显式提取特定的值/元素。我还有其他web服务响应,需要我解析这些数据以进行端到端测试

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.ompum-open.org/wss/2004/01/ompum-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.ompum-open.org/wss/2004/01/ompum-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
      ...
   </soap:Header>
   <soap:Body>
      <AuthUserResponse xmlns="http://localhost/ABC/Services/Security/">
         <AuthTicket>k3l5d9k6-3z53-8765-b512-df09as87</AuthTicket>
      </AuthUserResponse>
   </soap:Body>
</soap:Envelope>
*** Settings ***
Library  SudsLibrary

*** Test Case ***
Check App Auth Ticket
    Create Soap Client    http://localhost/Services/Authentication.asmx?wsdl
    ${WSDLobj}    Create Wsdl Object    AuthUser
    Set Wsdl Object Attribute    ${WSDLobj}    userName    MyAdmin
    Set Wsdl Object Attribute    ${WSDLobj}    password    Password123
    ${result}    Call Soap Method    AuthUser    ${WSDLobj}
    log    Result: ${result}
    # Now get the specific element from the response
    ${AuthVal}    Get Wsdl Object Attribute    ${result}    AuthTicket
    log    Auth Ticket: ${AuthVal}