{"id":17645686,"url":"https://github.com/mderevyankoaqa/jmeter_response_validator","last_synced_at":"2025-03-30T07:15:36.180Z","repository":{"id":46292951,"uuid":"341505272","full_name":"mderevyankoaqa/jmeter_response_validator","owner":"mderevyankoaqa","description":"Provides the sample code to validate the JMeter response. Also there is capability to save the results with details to the csv file (request, response). ","archived":false,"fork":false,"pushed_at":"2021-11-09T12:17:37.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T09:19:28.477Z","etag":null,"topics":["jmeter-plugin"],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mderevyankoaqa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-23T09:50:17.000Z","updated_at":"2025-01-22T22:42:08.000Z","dependencies_parsed_at":"2022-09-01T12:10:47.205Z","dependency_job_id":null,"html_url":"https://github.com/mderevyankoaqa/jmeter_response_validator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderevyankoaqa%2Fjmeter_response_validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderevyankoaqa%2Fjmeter_response_validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderevyankoaqa%2Fjmeter_response_validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderevyankoaqa%2Fjmeter_response_validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mderevyankoaqa","download_url":"https://codeload.github.com/mderevyankoaqa/jmeter_response_validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285816,"owners_count":20752958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jmeter-plugin"],"created_at":"2024-10-23T10:58:25.310Z","updated_at":"2025-03-30T07:15:36.163Z","avatar_url":"https://github.com/mderevyankoaqa.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JMeter response validator\n\n## Description\nThe plugin provides the possible to validate the response code and body. The details of the failed request:\n\n* Sampler name\n* URL\n* Request data\n* Response code with headers and body\n* Error details\n\nThe details can be saved to external system or to the file on the disc. The idea is to have the output which can be addressed to DEV team for the analysis. \n\n## Compatibility\nThe supported versions:\n* Java 8\n* JMeter 5.4.1 and upper \n\n\n## Installation \nPut file `jmeter-plugins-mdqa-response-validator-x.x.jar` to `~\\apache-jmeter-x.x.x\\lib\\ext`\n\n## Example of the usage\nAdd JSR223 Assertion with the following code:\n~~~~\nimport mdqa.jmeter.response.validator.*\nimport mdqa.jmeter.response.validator.models.*\nimport mdqa.jmeter.response.validator.helpers.*\n\nTestContext testContext = new TestContext(ctx)\n\nResponseValidator responseValidator = new ResponseValidator()\n.thisResponse(testContext.getResponse())\n.shouldHaveCode(\"200\")\n.shouldContainText(\"Test\")\n.shouldContainValuesWithOrLogic(\"Test11\",\"Boolean\")\n\nif (responseValidator.isValid() == false)\n{\t\t     \nAssertionResult.setFailure(true)\nAssertionResult.setFailureMessage(responseValidator.getValidationMessage())\n\n      String csvRow = new CSVRowBuilder(testContext)\n\t\t\t\t\t.setSeparator(\"|\")\n\t\t\t\t\t.putRequest()\n\t\t\t\t\t.putResponse()\n\t\t\t\t\t.putErrorMessage(responseValidator.getValidationMessage())\n\t\t\t\t\t.getRow()\n\t\t\t\n\tLogger logger = new CsvLogger()\n\t                // checks whether the validation is enabled using JMeter variable\n\t\t\tlogger.isEnabled(vars.get(\"LogIsEnabled\").toBoolean())\n\t\t\t// gets file path from variable\n\t\t\tlogger.setFilePath(vars.get(\"LogPath\").toString())\n\t\t\t// replaces the chars to have single line\n\t\t\tlogger.saveMessage(csvRow.replace(\"\\n\", \"\").replace(\"\\r\", \"\"))\t \n\n}\n~~~~\n\n## CSV file caption\nThis version of the plugin does not write caption for CSV file. You can add it manually, for example for the code like bellow:\n\n~~~~\nString csvRow = new CSVRowBuilder(testContext)\n.setSeparator(\"|\")\n.putRequest()\n.putResponse()\n.putErrorMessage(responseValidator.getValidationMessage())\n.getRow()\n~~~~\n\nYou can use the CSV file caption\n~~~~\nrequest.name|request.url|request.headers|request.body|response.code|response.headers|response.body|error\n~~~~\nThe programming code can be used as well to put it, depends on the contract of the row.\n\n## Text Plan example\nThe example of the code usage\n\n![](etc/test.plan.png)\n\nTo download the JMeter test plan click [here](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/mderevyankoaqa/jmeter_response_validator/blob/dev/etc/mdqa.jmeter.response.validator.example.jmx)\n\n## Recommendation\nPlease be careful with Virtual Users settings. This plugin is supposed to be used while smoke/functional tests with low load (1-10 users). The physical disc can be overloaded on the JMeter server while load tests if you have a loot of errors (you can accept the risk and try to use it while load test, but you need to monitor that JMeter works well).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmderevyankoaqa%2Fjmeter_response_validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmderevyankoaqa%2Fjmeter_response_validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmderevyankoaqa%2Fjmeter_response_validator/lists"}