質問

この形式の石鹸応答があります

<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>
.

XPathアサーションにフィードするために、JMeterのオブジェクトコンテンツを抽出したい。

誰かがこれを行う方法を提案することができますか?

//return/objectTypeを試みましたが、DebugSamplerは私の変数の値が空白であることを示します。

役に立ちましたか?

解決

  • あなたが言及した応答を持つ要求の子としてXPath extractorを置きます。

  • 抽出器を設定する:

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

    私はそれがうまくテストしました。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top