In this tutorial, you'll learn how to write a mysql database test in JMeter with assertions.
—
Facebook: / gokcedbsql
—
Video Transcript:
—
Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn how to write a test for the MySQL database in apache J meter. Let's start by downloading the Jar file. That's required to connect to the MySQL database from Jmeter UI.
After unzipping the downloaded file, we have to move it to the lib folder of the Jmeter installation. Start by using the which command to get to the home directory of the Jmeter installation. From there, go to the lib exact folder followed by the lib folder.
This is the lib directory where you'll move the Jar file that you just downloaded. Next, let's go back to the Jmeter UI and start by renaming the test plan to the MySQL test plan. Next, add a thread group node and rename it to JDBC users.
Now, right-click on the JDBC users and add the JDBC connection configuration. Here enter the database connection parameters and then set a variable name for the created poll. Now, right-click on the JDBC users node again and add the JDBC request.
Here, write a SQL query that you would like to execute and specify the same variable name for the connection for the connection poll. Next, add a response assertion and specify a value that you would like to assert. In the response data under patterns to test, you can also specify a custom failure message in the case when the assertion fails.
Finally, let's add the review results tree node and click on the green start button to execute our test. Looks like our test failed because we are expecting the count to be 502 but the actual count turned out to be 522. Let's go back to the response assertion node and modify the expected result to 522 and rerun the test.
This time our test passed because the expected output matched the actual output. There you have it. Make sure you like, subscribe, and turn on the notification bell.
Until next time.
Смотрите видео How To: MySQL Test In JMeter (2 Min) | With Database Assertions онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Gokce DB 03 Июнь 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 95 раз и оно понравилось 3 посетителям.