How to Compare 2 JDBC response in Jmeter

March 5, 2019 368 views
Java Databases

I want to compare 2 JDBC responses in Jmeter:

I have Source reponse from 1 JDBC request as below in table format:

(Source DB)JDBC Response response1:

srcid1 | srcid2 | srcid3| srcid4 |

10 | 20 | 30 | GBP |

11 | 22 | 31 | USD |

(Target DB)JDBC Reponse 2:

tgtid1 | tgtid2 | tgtid3 | tgtid4 |

10 | 20 | 30 | GBP |

11 | 22 | 31 | INR |

I am saving the response as String in JDBC Request (in Result Variable Name)

Now how do I compare the values in each column and Print Pass when values match. Fail it when the values do not match.

Number of rows can change.

Need help with assertion code or any other way this can be achieved in Jmeter.

1 Answer

Greetings!

It sounds like you're pulling values from a database and want to perform an operation on them with jmeter. I may be misunderstanding, so please correct me if you see that I am. I see jmeter as a load testing application, rather than something that would be ideal for performing operations on database queries.

I believe that the tool you require to compare these values would be something custom coded. I, for example, would probably do it in Python or a bash script because those are my specialties.

Jarland

Have another answer? Share your knowledge.