JMeter Pass Zvinosiyana Pakati PeMapoka Mapoka

Mune ino JMeter dzidziso, isu tinotarisa maitiro ekugovana uye kupfuudza akasiyana pakati pemapoka eshinda.

Paunenge uchigadzira yepamusoro JMeter zvinyorwa, zvingangoita iwe uchave uine akawanda tambo mapoka. Imwe neimwe tambo mapoka ichave ichiita zvakasiyana zvikumbiro.

Muenzaniso wakanaka weiyi ndipo patinofanirwa kuratidza vashandisi nemaBear Tokens. Imwe tambo yeboka inoita yechokwadi uye inochengetedza iyo chiratidzo. Rimwe boka tambo rinoda kuwana ichi chiratidzo uye nekuchishandisa mune chimwe chikumbiro.

Naizvozvo, isu tinoda nzira yekupfuura akasiyana pakati pemapoka eshinda.

Darika Misiyano Pakati PeMapoka Mapoka muJMeter

Semuenzaniso uyu, chirongwa chedu chekuyedza chichava nemapoka maviri eshinda. Yekutanga tambo yeboka inoita GET chikumbiro kune webhu saiti. Isu tinobva tashandisa iyo JSON Anoburitsa plugin kuenzanisa mhinduro yeJSON.

Tichishandisa JSONPath, tinobvisa kukosha kweimwe kiyi uye toichengeta seyakaenzana yeJMeter.



Aya ndiwo maratidziro atinoita chikumbiro cheJMeter:

Mhedzisiro yechikumbiro chiri pamusoro inogadzira inotevera mhinduro muJSON fomati:

uye yedu JSONPath yekubvisa iyo yekutanga url inoita senge:

Iko kukosha kwemubvunzo weJSONPath kunochengetwa se first_url. Musiyano uyu unongowanikwa mukati meboka rimwe chete reshinda uye tinogona kuwana kukosha kwaro nekushandisa ${first_url}. Zvino, tichaita sei kuti uyu musiyano usvike kuburikidza nemamwe mapoka tambo?

Mhinduro ndeye kushandisa BeanShell Assertion kuchengetedza iyo kusiana seyepasi rese chivakwa. Nenzira iyi, tinogona kupfuudza akasiyana pakati pemapoka eshinda.

Kuti uwedzere BeanShell Assertion, tinya kurudyi paYedzo Chirongwa> Wedzera> Assertion> BeanShell Assertion

Mune yedu BeanShell Assertion, tinogona kuisa inotevera kodhi

${__setProperty(first_url, ${first_url})};

Iye zvino mune tambo yeboka 2, tinogona kuwana uyu musiyano zvakananga nekushandisa ${__property(first_url)} sezvakaratidzwa pasi apa:

Kana, tinogona kushandisa BeanShell PreProcessor kushandisa musiyano:

MuBeanShell PreProcessor, isu tinokwanisa kuwana izvo zvakapatsanurwa zvichipfuura kubva kune rimwe Thread boka, nekushandisa props.get('name_of_variable'). Isu tinobva taita kumwe kudzvanya kweTambo uye kusevha mhedzisiro senzira itsva.

Mumuenzaniso uri pamusoro, tinobvisa http:// kubva pamusiyano uyo wakapfuudzwa kubva kuThinda Boka 1, uye isu tinochengeta mhedzisiro yacho seyakasiyana host.

Musiyano host yava yemuno kuThread Group 2 uye nekuiwana zvakananga nekushandisa ${host} sezvakaratidzwa pasi apa: