[Eolinker usage example] How can the same script make different response assertions for multiple data sets?

This week brought up the question about responding to assertions, as follows: Suppose there is a login interface, and two parameters are passed in the post request, namely username, password, and code. The first scenario: username does not exist; the response error code is 2000 Second scenario: password error; response error code is 2001 Third scenario: code error; response error code is 2002

So how to use Eolinker to make logical judgments in a script and make different response assertions? Use eo.error() code

The operation process is as follows:

The code in the pre-script is roughly as follows, you can refer to its logic: eo.info(eo.http.bodyParseParam); if(eo.http.bodyParseParam.username==''){ eo.error("The response error code is 2000")} if(eo.http.bodyParseParam.password!=2){ eo.error("The response error code is 2001")} if(eo.http.bodyParseParam.code!=3){ eo.error(" The response error code is 2002")}

The final result returned is as follows:

This week’s questions are about to be sorted out, everyone is welcome to comment and communicate~ Use address: www.eolinker.com

Guess you like

Origin blog.csdn.net/qq_40857096/article/details/112288858