Reputation: 23
File is getting download in jmeter bin folder from 'Save Responses to a file' assertion.
I'm not able to verify the downloaded file, Is there any assertion available other than MD5Hex Assertion or I need to write JAVA/Groovy code?
Upvotes: 0
Views: 546
Reputation: 58822
You can check using notExists with more readable version
import java.nio.file.*;
if (Files.notExists(Paths.get("Bulk.pdf"))) {
Upvotes: 0
Reputation: 168122
If you need to check file presence you can add a JSR223 Assertion and use the following code assuming File.exists() function :
if (!new File('Bulk.pdf').exists()) {
AssertionResult.setFailure(true)
AssertionResult.setFailureMessage('File is absent')
}
If the file will not be present you will get an error message like:
More information: Scripting JMeter Assertions in Groovy - A Tutorial
Upvotes: 2