函数用到:web_reg_find()、 lr_log_message()、 lr_eval_string()、strcmp()、atoi()

 

Action()
{
    web_reg_find("Text=liuej", "SaveCount=para_count", LAST); //文本检查,且保存变量

  web_submit_form("login.pl",
  "Snapshot=t3.inf",
  ITEMDATA,
  "Name=username", "Value={useranme}", ENDITEM,
  "Name=password", "Value={password}", ENDITEM,
  "Name=login.x", "Value=59", ENDITEM,
  "Name=login.y", "Value=1", ENDITEM,
  LAST);

 lr_log_message("username=%s  password=%s", lr_eval_string("{useranme}"), lr_eval_string("{password}"));

    lr_log_message("count= %d",lr_eval_string("{para_count}"));

    if (atoi(lr_eval_string("{para_count}"))>0)     //法1.验证是否找到了页面上的要检查的字符串
        lr_output_message("we find the string!");
 else
  lr_output_message("sorry,don't find the string!");


 if(strcmp(lr_eval_string("{para_count}"),"0")>0)  // 法2.验证是否找到了页面上的要检查的字符串
  lr_output_message("find");
 else
  lr_output_message("not find");

 return 0;
}

相关文章:

  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-11-28
  • 2021-06-25
  • 2022-12-23
  • 2021-07-16
  • 2022-03-06
猜你喜欢
  • 2022-01-05
  • 2021-12-30
  • 2021-12-21
  • 2021-09-10
  • 2022-03-11
  • 2021-11-08
相关资源
相似解决方案