若接口A的参数依赖于另一接口B,就需要用到关联接口的处理。
一、处理思路:先从接口B中提取出所需要的数据,通过Beanshell处理器将参数做处理,在接口A中调用Beanshell处理器中的参数。
二、所需的组件分为2大类:
2-1.后置处理器中的JSON提取器、正则表达式提取器、边界提取器;
2-2.后置处理器中的Beanshell处理器;
三、所需的函数有:
__setProperty(公用变量名,提取的引用名)}
__P(公用变量名,)
四、案例实操:
1、获取博文接口中的token依赖于登录接口中的loginName;
2、步骤如下: