Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test CAS with jmeter?

  • request:

    I send a "get" http request, has no parameters;
    path: http://192.168.22.139:8080/KSP

  • response:

    <input id="username" type="text" name="username" required/>
    <input id="password" type="password" name="password" required/>
    <input type="hidden" name="lt" value="LT-697-vbNmm6NKOZ0cd7Wg1ywzbMKLa0DnOc" />
    <input type="hidden" name="execution" value="e1s1" />
    <input type="hidden" name="_eventId" value="submit" />
    

And I add two XPath Extractor to get lt and execution:

  • reference name: lt;
    xPath query: //*[@id="login"]/input[3]
  • reference name: execution;
    xPath query: //*[@id="login"]/input[4]

enter image description here

Then I send another request with username/password/service/It/execution/_eventId:

enter image description here

Error: ticket and execution I get is empty, I get the xpath by chrome, so what is the problem?

like image 981
Olivia Wang Avatar asked Nov 18 '13 02:11

Olivia Wang


1 Answers

From the first response, can use Regular Expression Extractor to extract ticke and lt. extract ticket

Then send the second request with parameter:

username/password/It/execution/_eventId/_eventId enter image description here

By the way, you should add HTTP Cookie Manager, enter image description here

like image 81
Olivia Wang Avatar answered Oct 14 '22 20:10

Olivia Wang