Domanda

Ho una soap di risposta di questo modulo

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:Responseto xmlns:ns2="http://xyz.company.com/">
         <return>
            <objectContent xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">/path/to/file.txt</objectContent>
            <objectType>FILEPATH</objectType>
            <rid>111</rid>
            <sid>2</sid>
         </return>
      </ns2:Responseto>
   </S:Body>
</S:Envelope>

Vorrei estrarre l'oggetto contenuto in jmeter per alimentare xpath asserzione.

Qualcuno può suggerire come fare?

Ho provato //return/objectType ma poi il DebugSampler mi mostra che il valore della mia variabile è vuota.

È stato utile?

Soluzione

  • Mettere XPath Estrattore come un bambino di Richiesta che è la risposta che lei menziona.

  • Configurare l'estrattore come questo:

    "Main Sample" Only
    "Use Namespaces" checked
    "Ignore Whitespaces" checked
    "Return entire XPath fragment instead of text content" Unchecked
    "XPath query" : //return/objectType
    

L'ho testato e funziona.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top