loadrunner判断返回值
时间: 2023-11-01 18:08:06 浏览: 210
在LoadRunner中,可以使用lr_eval_string函数来判断返回值。该函数可以将字符串中的变量替换为其实际值,并返回结果。可以将该函数用于获取服务器响应,并判断响应中是否包含预期的值或文本。
例如,可以使用以下代码获取服务器响应并判断是否包含字符串"success":
```
char* response = web_get_str("http://www.example.com", "Param1=value1", LAST);
if (strstr(response, "success") != NULL) {
lr_output_message("Server response contains 'success'");
} else {
lr_output_message("Server response does not contain 'success'");
}
```
该代码会发送一个GET请求到http://www.example.com,并将响应存储在response变量中。然后,使用strstr函数判断response中是否包含字符串"success"。如果包含,则输出"Server response contains 'success'",否则输出"Server response does not contain 'success'"。
阅读全文
相关推荐
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231044901.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241231044901.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)