Home > other >  , o my rookie a great god help to see how to solve this problem, the along while also didn't kn
, o my rookie a great god help to see how to solve this problem, the along while also didn't kn

Time:09-23

Use jmeter beanshell Assertion results submitted to the wrong: an Assertion failure message: org. Apache. Jorphan. Util. JMeterException: Error invoking BSH method: eval Sourced file: inline evaluation of: ` ` dbcount=vars. GetObject (" dbcoins "). The size ();//database query to the total number of article actual_results=vars. Get ("... '

The code is as follows:
Dbcount=vars. GetObject (" dbcoins "). The size ();//database query to the total number of article
Actual_results=vars. The get (" coin_ALL ");//get all the coin in the corresponding to the field
String [] actualResults=actual_results;//will be the value of the array by comma split into
The info (actualResults length + "");//print from the response of the total number of values
If (dbcount==actualResults. Length) {//to assess the total number of database query results and whether the total response results, as well as continue item by item comparison
for(int i=0; iDb_name=vars. GetObject (" dbcoins "). The get (I). The get (" coin "). The toString ();//get data in the database corresponding to the name value of
If (db_name. Equals (actualResults [I])) {
Pool_raise_if_allocation_failure=false;//say assert success
} else {
Pool_raise_if_allocation_failure=true;
Results: FailureMessage="interface" + actualResult [I] + "and the database result:" + db_name + "inconsistent";
break;
}

}

} else {//quantity is not the same as the direct failure
Pool_raise_if_allocation_failure=true;
FailureMessage="interface results number" + actualResults. Length + "and the number of database results" + dbcount + "inconsistent"

}

CodePudding user response:

The database connection is configured?