Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

LR http interface test template

Shulou Source: shulou.com Published: 2022-06-03 04:25:05 11月25日 Update

Lr directly clicks to create the script, and then write the code in action.

The specific script is as follows:

Action ()

{

Int status

Lr_start_transaction ("send")

Web_reg_find ("Search=All", / / the setting of checkpoint function

"SaveCount=ret_Count", / / the name saved by the parameter to be found

"Text=ahbei"

LAST)

Status=web_url ("usermsg"

"URL= http://bubbler.labs.douban.com/j/user/ahbei", / / Interface to be tested

"TargetFrame=Main"

"Resource=0"

"RecContentType=text/html"

"Mode=http"

LAST)

Lr_output_message ("Request Status:%d", status)

Lr_output_message ("number of returned values found:% d", atoi (lr_eval_string ("{ret_Count}")

If (atoi (lr_eval_string ("{ret_Count}")) > 0) {/ / the number of checks is determined here

Lr_output_message ("Rec successful.")

Lr_end_transaction ("send", LR_PASS)

}

Else {

Lr_error_message ("Rec failed")

Lr_end_transaction ("send", LR_FAIL)

}

Return 0

}

Tags: Number script check interface test code function parameter name checkpoint template Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB macOS OPPO Reno Shulou Information