Oli*_*ang 7 xpath cas jmeter single-sign-on
请求:
我发送一个"get"http请求,没有参数;
路径:http://192.168.22.139:8080/KSP
响应:
<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" />
Run Code Online (Sandbox Code Playgroud)我添加了两个XPath Extractor来获取lt和execution:
lt; //*[@id="login"]/input[3]execution; //*[@id="login"]/input[4]
然后我发送另一个请求username/password/service/It/execution/_eventId:

错误:我得到的票证和执行是空的,我通过chrome获取xpath,那么问题是什么?
从第一个响应,可以使用正则表达式提取器来提取ticke和lt.

然后使用参数发送第二个请求:
username/password/It/execution/_eventId/_eventId
顺便说一下,你应该添加HTTP Cookie管理器,

| 归档时间: |
|
| 查看次数: |
3001 次 |
| 最近记录: |