Mashandisiro Ekushandisa ForEach Mutongi muJMeter

ForEach Mutongi muJmeter iterates kuburikidza nemhando dzakasiyana.

Mune ino JMeter dzidziso, isu tinoshandisa iyo ForEach Mutongi kusunungura kuburikidza neJSON Array.

Pane dzimwe nguva apo patinofanirwa kuongorora mhinduro uye kubvisa imwe ruzivo kubva mairi. Semuenzaniso, kana tichiyedza API, tinogona kuwana mhinduro yeJSON iyo inogona kuve neJSON Arrays.

Ipapo, isu tinofanirwa kusunungura kuburikidza neakarongeka uye kune chimwe nechimwe chinhu chinoita chiito. MuJMeter, tinogona kushandisa ForEach Mutongi kuti iterate kuburikidza neJSON Array.

Mashandisiro Ekushandisa JMeter YeEach Mutongi

Mumuenzaniso uyu, tichave tichiita chikumbiro cheGET kune zviwanikwa zvinodzosera mhinduro yeJSON.



Mhinduro yacho ine Array yezvinhu zveJSON.

Kune chimwe nechimwe chinhu, tinoda kutora iyo URL yatingaite kuburikidza neJSONPath.

Iyo JSONPath yekuwana ese ma URL mumhinduro iri pamusoro ndeye $.[*].url. Kana tangoongorora mhinduro yeJSON uye tobvisa ma URL, isu tinobva tave nerondedzero yeTambo, chaizvo ma URL.

Isu tinochengeta rondedzero iyi musiyano inonzi url_array

Zvino fungidzira kuti pachinhu chimwe nechimwe cheString array, isu tinoda kukumbira iyo URL. MuJMeter, izvi zvinoitwa nekushandisa ForEach Mutongi.

Kuwedzera iyo ForEach Mutongi kune yako bvunzo chirongwa, kurudyi tinya pane Thread Boka> Wedzera> Logic Controller> ForEach Mutongi

Iyo ForEach Mutongi inoda paramita mbiri:

  • Kuisa chinongedzo chinoshanduka
  • Kuburitsa zita rinoshanduka

Iyo Kuisa chinongedzo chinoshanduka inotora zita rekushanduka kwakarongeka, mune uyu muenzaniso, url_array . Zve Kuburitsa zita rinoshanduka , isu tinopa chinoshanduka, mune uyu muenzaniso, url_index iyo yatinozoshandisa mukukumbira kunotevera.

Zvino, muzvikumbiro zvedu zvinotevera, tinogona kutora kukosha kwega kwega nekushandisa ${url_index}

Izvi zvino zvichavhurika kuburikidza nekupinda kwega kwega muJSON Array uye voita zvikumbiro zveHTTP kuma URL.