Published: 10 Aug 2018 › Updated: 10 Aug 2018
BeanShell Assertion for multiple sub-results in JMeter
You can use standard "Response Assertion" or other CSS or XPath assertions to check your JMeter requests' responses.
But, if there are situations such redirection, there will multiple responses for each request. In case of you need to check all that sub results, standard assertions can't provide any easy solution.
An optimized solution is to use BeanShell Assertion:
Subresults = SampleResult.getSubResults();
int numOfsubResult = Subresults.length;
print("Num of sub results: " + numOfsubResult);
for(int i =0; i<numOfsubResult; i++){
print(Subresults[i].getResponseCode());
print(Subresults[i].getURL().getPath());
print(Subresults[i].getUrlAsString());
}
Leave BeanShell Assertion for multiple sub-results in JMeter to:
Read more #technology posts
Best Posts From Mahsum Akbas
We have not curated any of mahsumakbas's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Mahsum Akbas
- Tekrardan merhaba ve yeni bir soluk
- My Youtube channel of IT trainings
- A sunny winter day in Istanbul and beautiful sea
- Estonya e-vatandaşlık(e-residency)
- Self Check-in safe box
- Google doesn't appear in "search engine" results
- Diziden güzel bir müzik: Neil Diamond - If You Go Away
- Üniversitelerin ücretsiz kursları
- Some suggestions for good serials / Güzel dizi önerisi
- Walking in a snowy park