API Automation Testing : Is there any way to automate download scenario with content validation?

2 options.

  1. If you are sure the binary contents of the file will never change, do a binary comparison, see this example: upload-image.feature: And match response == read('karate-logo.jpg')

  2. You have to write some custom code. There are Java libraries to read Excel. Use one of those, read the data, and then compare with expected results. Refer the docs on Java interop and write a helper function to do this.

EDIT – also see this answer: https://stackoverflow.com/a/53050249/143475

Leave a Comment