loadrunner - 如何在 web_reg_find 中使用 if 条件
问题描述
如何将 if 条件与web_reg_find 合并
例如
if
{
web_reg_find("Search=Body", "Text=Launch Title", LAST);
//----Passes
{
printf("%d\n", login successful); /* user will login
}
}
Else
{
printf("%d\n", login not successful); /* user will not login
}
代码结束
解决方案
我会建议使用 web reg find 函数的 savecount 属性,它会保存在页面上找到文本的次数。
web_reg_find("Text=Welcome","SaveCount=Welcome_Count",LAST );
.........
......
if (atoi(lr_eval_string("{Welcome_Count}")) > 0){
lr_output_message("Login successful.");
}
else{
lr_error_message("Login failed");
return(0);
}
推荐阅读
- vba - 为什么 Range.Value = Left(....) 不起作用?
- php - Laracasts 教程:方法 'Latest()' 被删除了吗?
- keras - 在 Keras 中附加张量
- r - rowSums 在不修改基础数据框的情况下排除 dplyr 管道中的特定值
- java - 使用枚举查找长字符串描述
- javascript - 如何防止 MVC 动作并使用 javascript 函数
- python - 使用python将包含多个值的FIX标签写入字典
- apache-flink - 我们可以有使用 Flink 的 Batch / DataSet API 的窗口吗?
- python - Rabbit MQ 重启后消费者不会重新连接
- sql-server - 如何使用 VBA 加速 Access 和 SQL Server 之间的表传输?