8.关联

第八步:关联

所谓关联, 就是第二个Requst, 使用第一个Request中的数据

我们需要在第一个Http Requst 中新建一个正则表达式,把Response的值提取到变量中,提供给别的Http Request 使用

选择第一个Http Request, 右键 Add -> Post Processors -> Regular Expresstion Extractor

 

现在新建第二个Http Request,     发送到: http://www.weather.com.cn/weather2d/${citycode}.html 

${citycode} 中的数据, 是从Regular Expression Extractor 中取来的

 

到这, 脚本就全部写好了, 运行下,看下最终结果

Posted in 入门部署教程.