JMeter Dzidziso: Kuedza REST Webhu Services

Mune ino Jmeter Tutorial, isu tinotarisa maitiro atingaedze REST API kana Webhu saiti tichishandisa Jmeter chishandiso.

Tinogona kushandisa Jmeter kutumira chikumbiro chaJson kuRESTful Web Service uyezve kuongorora mhinduro yaJson.

Bvunzo Chirongwa che REST RAKASHANDA Webhu

  • Thread Boka
  • Chikumbiro cheHTTP

Kunge chero bvunzo dzeJmeter, isu tinotanga toda kugadzira Thread Boka pamwe neHTTP Kumbira Sampler.

kuyedza-kuzorora-jmeter-1

Kana iwe zvino uchimhanya iyo bvunzo, iwe unogona kuwana kukanganisa nekodhi yekupindura ye415 uye nemhinduro yekupindura 'Unsupported Media Type'.

Izvi zvinodaro nekuti REST API inogona kutarisira 'Zvemukati-Rudzi' uye 'Kuwana' parameter muchikumbiro chemusoro.



kuyedza-kuzorora-jmeter-7

  • HTTP Musoro Wemusoro

Tevere tinofanirwa kuwedzera HTTP Header Manager kutumira paramita mumusoro wechikumbiro. Isu tinofanirwa kutumira 'Zvemukati-Rudzi' uye 'Kuwana' misiyano semusoro wekukumbira

kuyedza-kuzorora-jmeter-3

kuyedza-kuzorora-jmeter-4

Zvingangodaro, unofanirwa kunyoresa kunyorera kuburikidza nekiyi yeAPI. Izvi zvinoda kutumirwa senge POST nzira kune iyo REST API mune iyo muviri wechikumbiro .

  • POST data muMuviri weKukumbira

kuyedza-kuzorora-jmeter-8

Uye mhinduro iri muJson fomati

kuyedza-kuzorora-jmeter-9

Tevere kuburitsa kana kuratidza iyo Json Mhinduro.

  • Bvisa Json Mhinduro

Jmeter ine anobatsira plugin inonzi JsonPath iyo inogona kushandiswa kuongorora mhinduro dzaJson.

Paunenge iwe waisa iyo iripamusoro plugin, isu tinogona kushandisa iyo Json Path Extractor seye posvo processor

kuyedza-json-nzira-kudhonza

Kana tangowedzera Json Path Extractor kuchirongwa chedu chekuyedza, tinogona kushandisa dot notation kunongedzera zvinhu zveJson.

Mumuenzaniso uyu, isu tinoda kutora kukosha kwe 'client_id':

json-nzira-mushanyi

Kukosha kwe 'client_id' kuchachengetedzwa mushanduro inonzi 'client_id_value'. Iwe unogona kupa chero rinoreva zita raunoda.

Kana ukango chengetedzwa muzita rinoshanduka, tinokwanisa kurangarira kukosha nekushandisa iro zita rinoshanduka mune fomati $ {client_id_value}

jmeter-zororo-kuyedza