【发布时间】:2016-02-03 14:09:42
【问题描述】:
我正在使用 JMeter 运行一些 Web 服务测试,这是我的问题:
- 这是我的测试结构:
> Threadgroup > -User Defined Variables > -SOAP/XML-RPC Request1 > ->Xpath Extractor > ->Beanshell PostProcessor > -SOAP/XML-RPC Request2 > ->HTTP Authorization manager > ->Beanshell PreProcessor > -Debug Sampler > View Results Tree
Xpath Extractor 处理 Request1 结果以提取密码,而 Beanshell PostProcessor 将其存储在用户定义的变量“授权”中。
Beanshell PreProcessor 从变量中提取密码,在授权管理器中使用用户设置。
AuthManager authmanager = sampler.getAuthManager(); Authorization authorization = new Authorization(); authorization.setURL("http://localhost:1130"); authorization.setUser("user"); authorization.setPass(vars.get("Authorization")); authorization.setRealm("gSOAP Web Service"); authmanager.addAuth(authorization);
在我需要循环组线程之前,一切都运行良好。第一个循环工作正常,但其余的执行失败。似乎在第二轮授权管理器没有更新新的凭据,导致以下请求失败。
我尝试在创建新授权之前清除授权管理器,但它不起作用。
救命!!
【问题讨论】:
标签: jmeter