In this post, we consider the situation when JMeter request which was recorded with “HTTP(S) Test Script Recorder” does not work but if you repeat steps with browser everything works fine and if you have already tried to debug JMeter script but with no results. In more detail, you recorded HTTP request which should check some sort of API action but when run JMeter script occurring error. API, in turn, didn’t return accurate information about the error. If you try to repeat the steps using a browser then everything works fine. The first thing that may come to mind it so HTTP Cookie Manager, but if after adding HTTP Cookie Manager error persists then have to use Wireshark to see what is wrong. So, open Wireshark, select the network interface if you do not know what interface to choose, choose “any”.
Now run sniffing and write in the box Filter:
http.request.method == "DELETE"
Instead of “DELETE” you can assign “GET”, “POST”, “PUT” according to the method.
After that, open the browser and perform the steps that we need, if the connection between the browser and the server is encrypted you’ll have to decrypt Wireshark packets, but if not then you will see the requests sent. Now you need to save them in a text format, for this select “File” -> “Export” -> “as ‘Plain Text’ file …”. In the new window, select “All expanded”, “Displayed”, insert the name of the file. After that, we need to repeat the previous steps, but only need to capture requests through JMeter. After that, you will have two files with captured packets. Now run or install program Meld:
sudo apt-get install meld
Open the program and select two captured files to compare them.