I'm having a problem not sure if it is a bug or not.
Making the long story short.
I use jmeter 3.0 and bundled json path extractor with some rest api to make subsequent calls with foreach.

Lets say we have this scenario
country api -> region api ->city api->shop list
Get the country list and extract the array of country id and pass it to a foreach get regions list for each country, another call to region api and exctract the cities from the result

Generally everithing works, I get an array and the foreach works as expected. But there are situation where I get only one result, because for instance there is only one region in the country. In this case json path extractor do not give an array but a simple string var. This cause the following foreach to not get executed. I'm not sure if this is the normal behaviour but this completely broke my script. Another strange thinks is that I used the debug sampler to monitor the script and the array never appear there but it exist since the foreach get executed, the var appear only when is a string.

Here is a debug example:


for idCountryList I expect to see as first line something like
idCountryList = [37, 38]
While idCityList appear because is not an array since the json contain just one result. In this real example after extracting the city list I have another api call that do not get executed because idCityList is not an array so the foreach get jumped.
I hope I've been clear.
Thank for any support

"Ai sensi e per gli effetti della legge sulla tutela dei dati personali (D.lgs 196/2003), le informazioni contenute nella presente @mail sono di natura riservata e destinate ad un uso aziendale-lavorativo con esclusione di utilizzi ad uso personale; come tali, pertanto, sono riservate esclusivamente ai destinatari sopra indicati. E' proibito leggere, copiare, usare o diffondere il contenuto della presente @mail senza autorizzazione. Se avete ricevuto questa @mail per errore, siete pregati di rispedire la stessa al mittente.

To unsubscribe, e-mail: user-unsubscr...@jmeter.apache.org
For additional commands, e-mail: user-h...@jmeter.apache.org

Reply via email to