-1

My HTTP Request in JMeter running successfully but any data don't map in database.But if I run my application manually, Data are logging correctly in database.I have not created any database connection. I am not sure whether it is a right behavior or not. I created my JMeter script using HTTP(S) TEST SCRIPT RECORDER Please help me, I am new on JMeter.

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
shivam
  • 27
  • 1
  • 3

1 Answers1

0

Well-behaved JMeter test should act exactly in the same manner as manual execution of the same steps. If you see different behaviour most likely your test is not doing what it is supposed to be doing.

In the majority of cases you cannot just record and replay your test scenario as modern websites widely use dynamic tokens for various reasons:

So the chance you will be able successfully replay recorded test is minimal. In order to fix the recorded test scenario "skeleton" take the following steps:

  1. Add HTTP Cookie Manager to your Test Plan
  2. Perform correlation:

    • detect all dynamic parameters (you can record your test one more time and compare JMeter scripts, if there will be differences - you will need to correlate those values which differ)
    • extract them from previous responses using one of JMeter Post-Processors and save into JMeter Variables
    • use aforementioned JMeter Variables instead of hard-coded recorded values
  3. Once done run your test with View Results Tree listener enabled and inspect request and response details to check integrity of your test

There is also an alternative way of recording JMeter tests via cloud-based proxy server, it is capable of exporting recorded scripts in "SmartJMX" mode with automatic detection and correlation of the dynamic parameters, check out How to Cut Your JMeter Scripting Time by 80% article if interested

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I created two scripts manually for each of them and two Application ID suppose 963 and 964 generated. Every thing is same except URL of PATH within HTTP Request--- PATH of first script:-- /ccd/login/login.do;jsessionid=FF1298246252F4114E1F3F273CA06A28.106 PATH of second script:-- /ccd/login/login.do;jsessionid=E1A93A11FBA42768AF8032AAF333DF8E.106 I also added HTTP Cookie Manager where Clear Cookies Each Iteration is not selected. HTTP Header Manager also added Do I need to add regular expression for that or it is fine? – shivam Aug 18 '17 at 19:49