Extract information from page after redirect in taurus

二次信任 提交于 2020-07-10 06:51:07

问题


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

回答1:


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

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

scope: children 

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

bzt your-test.yaml -gui 

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

More information: Navigating your First Steps Using Taurus



来源:https://stackoverflow.com/questions/62759416/extract-information-from-page-after-redirect-in-taurus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!