Oauth 2.0 Soapui-oauth2不点击“获取访问令牌”;获取令牌“;

Oauth 2.0 Soapui-oauth2不点击“获取访问令牌”;获取令牌“;,oauth-2.0,soapui,Oauth 2.0,Soapui,如何在脚本开始时自动启动oauth2令牌检索,而无需单击“获取令牌”?我找到了启动oauth2获取令牌的groovy脚本: import com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade def authContainer = testRunner.testCase.testSuite.project.OAuth2ProfileContainer // Get OAuth2 profile name def pr

如何在脚本开始时自动启动oauth2令牌检索,而无需单击“获取令牌”?

我找到了启动oauth2获取令牌的groovy脚本:

import com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade

def authContainer = testRunner.testCase.testSuite.project.OAuth2ProfileContainer
// Get OAuth2 profile name
def profileName = context.expand("Oauth2")
def authProfile = authContainer.getProfileByName(profileName)

def clientFacade = new OltuOAuth2ClientFacade()
clientFacade.requestAccessToken(authProfile)
//To get the access token
def accessToken = authProfile.getAccessToken()

我现在正在经历同样的问题。目前我唯一能找到的是:或者说:我编辑了代码,但找不到包com.eviware.soapui.support.editor.inspectors.auth.tokentypes,该代码对我来说运行良好-使用ReadyAPI 2.3.0。