Jmeter- assertion

Jmeter- assertion

Assertion Response data server component is used to do authentication.

 

BeanShell Assertion

BeanShell assertion, BeanShell as a scripting language, you can easily call JAVA classes and attributes Jmeter

1) log objects, you can use this object to write the log

2) SampleResult objects, from which the fetch response data, the response information codes, read-only.

3) Response objects, the fetch response data, read-only

4) Failure, used to set the assertion success, Boolean type

5) FailureMessage, failure information is used to set

6) ResponseData objects, the fetch response data

7) ResponseCode, response code

8) ResponseMessage, response information

9) ResponseHeaders, response headers

10) RequestHeaders, request headers

11) SampleLabel, sampler information Label

12) SampleData, data sent to the server

13) Ctx (JmeterContext), Jmeter context information, which you can obtain information on the number of threads, thread number, etc.

14) Vars (JmterVariables), defined Jmeter acquisition variable, or set variables

15) Props (JmeterProperties), acquired Jmeter attributes, an attribute is set, or

 

3,6,7,8,9,10,11,12 can get in the SampleResult

 

 

Compare Assertion

Compare assertion that compares two sampling results, the results support the regular expression filtering.

Disadvantages: consume more resources, is not recommended

Main use: generally used for debugging, in conjunction with the use of Compare Asertion Comparion Assertion Visualizer, pre-set, which asserts the results displayed.

 

Size Assertion

Size authentication response data size, its scope and the sub main Sample Sample.

 

Name: Add to the element name can be null

Note: can be empty

Apply to: assert range of applications

Main sample and sub-samples: Sample assertion includes a main portion and a sub Sample

Main sample only: only the main part of the assertion Sample

Sub-sample only: Sample assertion is a sub-section only

Jmeter Variable: Jmeter variable part is the assertion

Respose Size Field to Test: Which part of the domain in response to the assertion participation

Full Response: All response information

Response Headers: Response header information, the header information such as protocol Http

Response Body: response portion relating to the content, such as the body part in the html code protocol Http

Response code: response code, such as 200,503

Response information: response information, such as OK

Size to Assert: threshold setting assertion

 

Duration Assertion

Duration asserted, test run verification time sampler consumed, may milliseconds for the main and the sub-sampler sampler unit of time.

If the assertion is longer than the actual time-consuming set, the assertion ended in failure.

Guess you like

Origin www.cnblogs.com/marton/p/11286157.html