Search code examples
jmeterjmeter-plugins

How can i get dynamic values(lectureid) while click 'Add' button in jmeter


My scenario,

While click "Add" button, Getting "lectureid" from the database for my application.

In the above scenario, How can I get 'lecture id'(dynamic) value in JMeter3.0 and refer the snapshot?

enter image description here

Kindly give me the solution for this scenario.


Solution

  • Your Regular Expression Extractor configuration should be like:

    Reference name: Courselectureid (Could be anything)
    Regular Expression: "courselectureid":(\d+)
    Template: $1$
    Match No.(0 For Random): 1
    

    For Regex test see here: https://regex101.com/r/MdHaYq/1

    Here, the total number of match found will be 4, but you need to extract only one of the values 1429. That's why Match No.(0 For Random): 1 is used. You could use the value 0, in that case, it will pick a match randomly. In you case, it will not have any impact as all the matches are returning the same value 1429.