如何在JMeter中登录Google帐户 [英] How to do a Login woth a google account in JMeter

查看:59
本文介绍了如何在JMeter中登录Google帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试登录使用Google帐户登录名的应用程序.我尝试使用脚本记录器,但是它不起作用.

I try to login into an application that uses a login with Google Accounts. I try with the script recorder but it doesn't work.

推荐答案

最有可能通过 OAuth 协议,因此您无法记录和重播此协议.实际上,您不需要对登录过程本身进行负载测试,因为它通常是在Google端执行的.

Most probably login via Google Account is implemented using OAuth protocol and this is not something you can record and replay. Actually you don't need to load test the logging in process itself as it mostly being performed on Google side.

要通过身份验证,您需要通过JMeter的 Authorization Bearer 令牌href ="http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Header_Manager" rel ="nofollow noreferrer"> HTTP标头管理器.可以使用以下方式之一获取令牌:

In order to be authenticated you need to supply correct Authorization Bearer token via JMeter's HTTP Header Manager. The token can be obtained using one of the following ways:

  • By recording (look for Authentication: Bearer token in the HTTP Header Manager
  • Using real browser from the WebDriver Sampler and once you're logged in - copy session information from browser into JMeter
  • From the Google Console if you have permissions
  • By performing full authentication process using i.e. OAuth Client Library for Java from JSR223 Sampler

请参见如何在其上运行性能测试带有JMeter的OAuth安全应用程序一文,详细介绍了每种方法.

See How to Run Performance Tests on OAuth Secured Apps with JMeter article for more detailed explanation on each of the approaches.

这篇关于如何在JMeter中登录Google帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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