0

I have a JMeter script in which I'm extracting value from the response of first request via Regular Expression Extractor and sending it in the second request. This mechanism is not working in my script

Response of the first request (formatted for readability):

42["createGameRsp",
  {"response":
    {"title":"Create Successful",
     "result":"TestL38 was successfully created. \n GameID: 956 \n Password: ",
     "error":"",
     "game":"texas",
     "gameID":956}
  }]

Regular Expression Extractor:

Regular expression for gameID

Request of 2nd Request:

42[
    "get_joingame",
    {
        "uid": "vGeUNHNEA7JYnyUmxAdS8djGVDpSBEJq",
        "key": "AUEEW891WL",
        "socketId": "kwLZQOQHeY8hG1eSAArP",
        "username": "611839990703",
        "avatar": "avatar1.jpg",
        "language": "en",
        "playerMove": "",
        "joinGame": "",
        "replay": 0,
        "gameID":"${gameID}",
        "gameNo": 0,
        "data": "&seat=5&buyin=500&privateTable=2&clubId=0",
        "players": 0
        "level": 345,
        "lastAction": "ep.playNow",
        "game": "texas",
        "playMoney": 1,
        "role": "1",
        "playerId": 23910,
        "displayName": "p10",
        "seat": 5
    }
]

Please let me know how it will work.

1 Answer 1

2
  1. Remove quotation marks from your regular expression so it would look like:

    "gameID":(\d+)
    
  2. It would also be a good idea to put the regular expression extractor to be a child of the request which returns this gameID, otherwise it will be overwritten by the next request

More information:

1
  • Its not working for me @Dmitri T I tried the same as you mentioned in the game. Any other suggestion?
    – Kavita
    Commented Dec 19, 2022 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.