Search code examples
javajmeteramazon-dynamodbdynamodb-queriesweb-api-testing

How to test DynamoDB aws in Jmeter?


Right now testing API which is hosted on amazon aws and it has dynamoDB. How do I check in Jmeter that DynamoDB table item count has increased than before sending my api requests?

Currently I am sending bulk requests to read json files, send them as body to same API endpoint and get their response. I want to check dynamoDB. Any help is appreciated.


Solution

    1. Download DynamoDB JDBC Driver and drop it to JMeter Classpath
    2. Restart JMeter to pick up the .jar
    3. Add JDBC Connection Configuration element and put your DynamoDB JDBC URL there. Other parameters like credentials, connection pool size, etc. can also be configured there
    4. Add JDBC Request sampler and put the query to get the current table item count. Save the result into a variable
    5. You can use a Response Assertion or JSR223 Assertion to compare the item count with the expected value if needed.