在金牛座中重定向后从页面中提取信息 [英] Extract information from page after redirect in taurus

查看:45
本文介绍了在金牛座中重定向后从页面中提取信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面/login 成功登录后,我们将被重定向到/files如何从/files页面提取信息?我用Jmeter做执行器

I have a page /login after successful login we will be redirected to /files How do I extract an information from /files page? I use Jmeter as executor


          - url: '${host}/login'
            method: POST
            label: 'Login'
            headers:
              Upgrade-Insecure-Requests: '1'
              Origin: 'null'
              Content-Type: application/x-www-form-urlencoded
              Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
            extract-xpath:
              requesttoken:
                xpath: //head/@data-requesttoken
                default: NOT_FOUND
                validate-xml: false
                ignore-whitespace: true
                use-tolerant-parser: true
            body:
              password: pass
              timezone: Europe/Berlin
              timezone_offset: '2'
              user: admin

推荐答案

JMeter应该 follow-redirects: true属性,则noreferrer>按照重定向进行操作. >

JMeter should follow the redirects given you provide follow-redirects: true property.

此外,您还需要通过添加下一行来将XPath Extractor的范围更改为子样本.

Also you will need to change the XPath Extractor's scope to sub-samples by adding the next line:

scope: children 

您始终可以通过运行以下命令来启动JMeter GUI:

You can always launch JMeter GUI by running the following command:

bzt your-test.yaml -gui 

Taurus会将您的YAML方案转换为JMeter测试计划,可以轻松启动和调试该计划.

and Taurus will convert your YAML scenario into JMeter Test plan which can be easily launched and debugged.

更多信息:使用Taurus导航您的第一步

这篇关于在金牛座中重定向后从页面中提取信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆