<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.5">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="テスト計画" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="ユーザー定義変数" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="SalesforceのAPIコールテスト" enabled="true">
        <stringProp name="TestPlan.comments">SalesforceにログインしてREST APIを実行するまでのサンプルです</stringProp>
        <stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="ループコントローラ" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
        <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
      </ThreadGroup>
      <hashTree>
        <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="ログイン" enabled="true"/>
        <hashTree>
          <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="ログイン設定" enabled="true">
            <collectionProp name="Arguments.arguments">
              <elementProp name="baseurl" elementType="Argument">
                <stringProp name="Argument.name">baseurl</stringProp>
                <stringProp name="Argument.value">login.salesforce.com</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
                <stringProp name="Argument.desc">login.salesforce.com、test.salesforce.com または私のドメイン</stringProp>
              </elementProp>
              <elementProp name="username" elementType="Argument">
                <stringProp name="Argument.name">username</stringProp>
                <stringProp name="Argument.value">YOUR_SALESFORCE_USERNAME</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
                <stringProp name="Argument.desc">Salesforceのユーザ名</stringProp>
              </elementProp>
              <elementProp name="password" elementType="Argument">
                <stringProp name="Argument.name">password</stringProp>
                <stringProp name="Argument.value">YOUR_SALESFORCE_PASSWORD</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
                <stringProp name="Argument.desc">Salesforceのパスワード</stringProp>
              </elementProp>
              <elementProp name="security_token" elementType="Argument">
                <stringProp name="Argument.name">security_token</stringProp>
                <stringProp name="Argument.value"></stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
                <stringProp name="Argument.desc">Salesforceのセキュリティトークン(不要な場合は空欄にする)</stringProp>
              </elementProp>
            </collectionProp>
          </Arguments>
          <hashTree/>
          <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="SalesforceへのSOAP APIリクエストデフォルト設定" enabled="true">
            <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="ユーザー定義変数" enabled="true">
              <collectionProp name="Arguments.arguments"/>
            </elementProp>
            <stringProp name="HTTPSampler.domain">${baseurl}</stringProp>
            <stringProp name="HTTPSampler.port"></stringProp>
            <stringProp name="HTTPSampler.protocol">https</stringProp>
            <stringProp name="HTTPSampler.contentEncoding"></stringProp>
            <stringProp name="HTTPSampler.path">/services/Soap/c/55.0/</stringProp>
            <stringProp name="HTTPSampler.concurrentPool">6</stringProp>
            <stringProp name="HTTPSampler.connect_timeout"></stringProp>
            <stringProp name="HTTPSampler.response_timeout"></stringProp>
          </ConfigTestElement>
          <hashTree/>
          <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SalesforceにSOAP APIでログイン" enabled="true">
            <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
            <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
              <collectionProp name="Arguments.arguments">
                <elementProp name="" elementType="HTTPArgument">
                  <boolProp name="HTTPArgument.always_encode">false</boolProp>
                  <stringProp name="Argument.value">&lt;soapenv:Envelope&#xd;
  xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&#xd;
  xmlns:urn=&quot;urn:enterprise.soap.sforce.com&quot;&gt;&#xd;
    &lt;soapenv:Header&gt;&lt;/soapenv:Header&gt;&#xd;
    &lt;soapenv:Body&gt;&#xd;
        &lt;urn:login&gt;&#xd;
            &lt;urn:username&gt;${username}&lt;/urn:username&gt;&#xd;
            &lt;urn:password&gt;${password}${security_token}&lt;/urn:password&gt;&#xd;
        &lt;/urn:login&gt;&#xd;
    &lt;/soapenv:Body&gt;&#xd;
&lt;/soapenv:Envelope&gt;</stringProp>
                  <stringProp name="Argument.metadata">=</stringProp>
                </elementProp>
              </collectionProp>
            </elementProp>
            <stringProp name="HTTPSampler.domain"></stringProp>
            <stringProp name="HTTPSampler.port"></stringProp>
            <stringProp name="HTTPSampler.protocol"></stringProp>
            <stringProp name="HTTPSampler.contentEncoding"></stringProp>
            <stringProp name="HTTPSampler.path"></stringProp>
            <stringProp name="HTTPSampler.method">POST</stringProp>
            <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
            <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
            <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
            <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
            <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
            <stringProp name="HTTPSampler.connect_timeout"></stringProp>
            <stringProp name="HTTPSampler.response_timeout"></stringProp>
          </HTTPSamplerProxy>
          <hashTree>
            <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="Salesforceログインのリクエストヘッダ" enabled="true">
              <collectionProp name="HeaderManager.headers">
                <elementProp name="" elementType="Header">
                  <stringProp name="Header.name">SOAPAction</stringProp>
                  <stringProp name="Header.value">urn:enterprise.soap.sforce.com/Soap/loginRequest</stringProp>
                </elementProp>
                <elementProp name="" elementType="Header">
                  <stringProp name="Header.name">Content-Type</stringProp>
                  <stringProp name="Header.value">text/xml; charset=utf-8</stringProp>
                </elementProp>
              </collectionProp>
            </HeaderManager>
            <hashTree/>
            <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="ログインレスポンスの検証" enabled="true">
              <collectionProp name="Asserion.test_strings">
                <stringProp name="1218933065">&lt;sessionId&gt;</stringProp>
              </collectionProp>
              <stringProp name="Assertion.custom_message"></stringProp>
              <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
              <boolProp name="Assertion.assume_success">false</boolProp>
              <intProp name="Assertion.test_type">16</intProp>
            </ResponseAssertion>
            <hashTree/>
            <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="セッションIdを抽出" enabled="true">
              <stringProp name="XPathExtractor.default"></stringProp>
              <stringProp name="XPathExtractor.refname">sessionId</stringProp>
              <stringProp name="XPathExtractor.matchNumber">1</stringProp>
              <stringProp name="XPathExtractor.xpathQuery">//sessionId/text()</stringProp>
              <boolProp name="XPathExtractor.validate">false</boolProp>
              <boolProp name="XPathExtractor.tolerant">false</boolProp>
              <boolProp name="XPathExtractor.namespace">false</boolProp>
            </XPathExtractor>
            <hashTree/>
            <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="フルのインスタンスURLを取得" enabled="true">
              <stringProp name="TestPlan.comments">フルのインスタンスURLを取得します(https://mydomain/services/Soap/c/55.0/00XXX....)</stringProp>
              <stringProp name="XPathExtractor.default"></stringProp>
              <stringProp name="XPathExtractor.refname">instanceurl_full</stringProp>
              <stringProp name="XPathExtractor.matchNumber">1</stringProp>
              <stringProp name="XPathExtractor.xpathQuery">//serverUrl/text()</stringProp>
              <boolProp name="XPathExtractor.validate">false</boolProp>
              <boolProp name="XPathExtractor.tolerant">false</boolProp>
              <boolProp name="XPathExtractor.namespace">false</boolProp>
            </XPathExtractor>
            <hashTree/>
            <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="インスタンスURLを取得" enabled="true">
              <stringProp name="RegexExtractor.useHeaders">false</stringProp>
              <stringProp name="RegexExtractor.refname">instanceurl</stringProp>
              <stringProp name="RegexExtractor.regex">https://(.*)/services/.*</stringProp>
              <stringProp name="RegexExtractor.template">$1$</stringProp>
              <stringProp name="RegexExtractor.default"></stringProp>
              <stringProp name="RegexExtractor.match_number">1</stringProp>
              <stringProp name="Sample.scope">variable</stringProp>
              <stringProp name="Scope.variable">instanceurl_full</stringProp>
            </RegexExtractor>
            <hashTree/>
          </hashTree>
          <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Debug Sampler" enabled="true">
            <boolProp name="displayJMeterProperties">false</boolProp>
            <boolProp name="displayJMeterVariables">true</boolProp>
            <boolProp name="displaySystemProperties">false</boolProp>
          </DebugSampler>
          <hashTree/>
        </hashTree>
        <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SalesforceへREST APIコール" enabled="true"/>
        <hashTree>
          <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="REST APIリクエストのデフォルト値" enabled="true">
            <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="ユーザー定義変数" enabled="true">
              <collectionProp name="Arguments.arguments"/>
            </elementProp>
            <stringProp name="HTTPSampler.domain">${instanceurl}</stringProp>
            <stringProp name="HTTPSampler.port"></stringProp>
            <stringProp name="HTTPSampler.protocol">https</stringProp>
            <stringProp name="HTTPSampler.contentEncoding"></stringProp>
            <stringProp name="HTTPSampler.path"></stringProp>
            <stringProp name="HTTPSampler.concurrentPool">6</stringProp>
            <stringProp name="HTTPSampler.connect_timeout"></stringProp>
            <stringProp name="HTTPSampler.response_timeout"></stringProp>
          </ConfigTestElement>
          <hashTree/>
          <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="取引先を作成する" enabled="true">
            <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
            <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
              <collectionProp name="Arguments.arguments">
                <elementProp name="" elementType="HTTPArgument">
                  <boolProp name="HTTPArgument.always_encode">false</boolProp>
                  <stringProp name="Argument.value">{&#xd;
  &quot;Name&quot; : &quot;JMeter Example&quot;&#xd;
}</stringProp>
                  <stringProp name="Argument.metadata">=</stringProp>
                </elementProp>
              </collectionProp>
            </elementProp>
            <stringProp name="HTTPSampler.domain"></stringProp>
            <stringProp name="HTTPSampler.port"></stringProp>
            <stringProp name="HTTPSampler.protocol">https</stringProp>
            <stringProp name="HTTPSampler.contentEncoding"></stringProp>
            <stringProp name="HTTPSampler.path">/services/data/v55.0/sobjects/Account</stringProp>
            <stringProp name="HTTPSampler.method">POST</stringProp>
            <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
            <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
            <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
            <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
            <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
            <stringProp name="HTTPSampler.connect_timeout"></stringProp>
            <stringProp name="HTTPSampler.response_timeout"></stringProp>
          </HTTPSamplerProxy>
          <hashTree>
            <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="REST APIリクエストのヘッダ(認証情報)" enabled="true">
              <collectionProp name="HeaderManager.headers">
                <elementProp name="" elementType="Header">
                  <stringProp name="Header.name">Authorization</stringProp>
                  <stringProp name="Header.value">Bearer ${sessionId}</stringProp>
                </elementProp>
                <elementProp name="" elementType="Header">
                  <stringProp name="Header.name">Content-Type</stringProp>
                  <stringProp name="Header.value">application/json</stringProp>
                </elementProp>
              </collectionProp>
            </HeaderManager>
            <hashTree/>
          </hashTree>
        </hashTree>
        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="結果をツリーで表示" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>true</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>true</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>false</xml>
              <fieldNames>true</fieldNames>
              <responseHeaders>false</responseHeaders>
              <requestHeaders>false</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
              <sentBytes>true</sentBytes>
              <url>true</url>
              <threadCounts>true</threadCounts>
              <idleTime>true</idleTime>
              <connectTime>true</connectTime>
            </value>
          </objProp>
          <stringProp name="filename"></stringProp>
        </ResultCollector>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>