First of all, I don't like your file path C:\Users\New\Desktop\Load_Testing
. In Java and Beanshell you need to escape back slashes like C:\\Users\\New\\Desktop\\Load_Testing
Second: make sure that you're sending a correct gzip
file. If Your C:\Users\New\Desktop\Load_Testing
file is not in gzip format, you'll need to convert compress it in your Beanshell Pre-Processor as follows:
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.GZIPOutputStream;
byte[] buffer = new byte[1024];
GZIPOutputStream gzos = new GZIPOutputStream(new FileOutputStream("C:/Users/New/Desktop/Load_Testing.gz"));
FileInputStream in = new FileInputStream("C:/Users/New/Desktop/Load_Testing");
int len;
while ((len = in.read(buffer)) > 0) {
gzos.write(buffer, 0, len);
}
in.close();
gzos.finish();
gzos.close();
And finally, make sure that you're sending correct Accept-Encoding header. To do so add a HTTP Header Manager and include gzip
value in Accept-Encoding
stanza.
Hope this helps.