0

How to extract sessionKey from the below response using Jmeter?

<iframe frameborder="0" scrolling="no" src="https://hpc.uat.freedompay.com/api/v1.2/controls?sessionKey=eyJhbGciOiJBMjU2R0NNS1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiaXYiOiJ3QWRBa0pYZHRFZjRJZ0FyIiwidGFnIjoiYnkza094VWcteTNMSVdGZXpwRXVZZyIsInppcCI6IkRFRiJ9.UyZuzOJjUUH_W4Y8562QQEE3sMInJBC5nbBw_iROmlT307ij_HpVTHIkkTGOYtjJ3fqqj98xrg6mmFQAYUvCMw.BK539lfAMdXR1W08rDGSew.W8fNSXnjy85FFMVBunjYJ81pTwhDxoNLfBAyh4xsr2442LYTxu_C8r4BsYrASO6cq1cN73K7IAOz-77fc17Vw49eb61wo8urEacXUcT8i8jy7fq4TrTqFq3YLgjiE-1Q8ytn9T9hKSrPIOABFhy69th4SpvHKTJ6qVSz1ZmQ6Df3jKVmL4CUXrqqLrSRuDg-0jFChqIjSROI8q-ZBfBoZxUZ6GWsek4GiLa21nWZHHeIB2yAMAX1c4oTQJr3kcKcslIlIKtRHGQYF2V9lDrnZflViY6a1ZzzAoNAK9avjEn3tK-mFLiBRzTxastq-TbfnFao5b1UVhVVx4woCIwgKw-WYl69x91dO6oPHexUTnfrd5J86zqQGZXzAwuA7E1tt1WJSz720mRfSFwduuF_8uisTHYPuAXC36y9n1fgQ3C0S6gbeVj9Hm1LpUuRgX81tYVIRb8EpZEaAcizp1TbEA.kZogTE6vDXDhIEO2joVCRC6FY3URy4aWcIqB7E2i4_k"></iframe>

1
  • Most of what you want can be found at zuhaibahmed.wordpress.com/2012/07/12/… Please attempt to use the information, then update your question with what you tried and the results you received. That will make the question eligible for reopening.
    – Kate Paulk
    Commented May 13, 2019 at 17:37

1 Answer 1

1

That is a html response. You will need to add an extractor to parse the HTML and extract the data. Using Jmeter right click on the thread group and select post processors, then CSS selector extractor. Once added define the variable name as var1, set the CSS selector expression to iframe, set the attribute to sessionKey, set match number to 1 and tick box for empty variable if nothing is found, like this:

enter image description here

Bare in mind that Jmeter offers a wide variaty of extractors (xpath, json, regular expression and so on), you can also use xpath or regexp here if that is what you prefer.

Not the answer you're looking for? Browse other questions tagged or ask your own question.