Jmeter测试登录 [英] Jmeter testing for Login

查看:125
本文介绍了Jmeter测试登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须测试一个使用Jmeter登录的Web应用程序.

I have to test a web-app for login using Jmeter.

那是怎么做的?

我应该在HTTP Request采样器中提供登录页面的路径,并将用户名和密码添加到登录配置元素中吗?

Should I give the path of the login page in the HTTP Request sampler and add the username and password to the login config element?

推荐答案

这需要切合实际,因此您的测试应设计如下:

It needs to be realistic hence your test should be designed as follows:

  1. HTTP GET请求(使用浏览器模拟打开登录页面)
  1. HTTP GET Request (simulate opening Login page with a browser)
    • Post Processor to fetch dynamic parameters values (if any)
  • (可选)响应声明,以验证用户是否确实登录了我
  • (optional) Response Assertion to verify that user is really logged i

我还建议添加 HTTP Cookie管理器来表示浏览器Cookie和交易基于cookie的身份验证.

I would also recommend adding HTTP Cookie Manager to represent browser cookies and deal with cookie-based authentication.

请参见如何要使用JMeter进行登录身份验证指南,以进行逐步概述和演示

See How To Use JMeter For Login Authentication guide for step-by-step overview and demo

这篇关于Jmeter测试登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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