SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Jmeter custom request error

    Hi,

    I'm using Jmeter tool to load test an http/html .NET application.

    There is a request in business process where in we delete an item from shopping basket. The sampler that is recorded in Jmeter is
    /pmclient/BuyersToolsAjaxService.asmx/Send

    Send parameters with Request is:
    Name:
    {"oId":["2531b9613c68431cbbfa","REMOVE_ROW"],"sValue":""}

    Value: blank

    I correlated the dynamic value in above sampler as:

    {"oId":["${rowIdToDel}","REMOVE_ROW"],"sValue":""}

    Regular expression extractor for ${rowIdToDel}as:

    {"enableReceive":true,"enableSend":true,"fieldMapp ing":\["(.*?)","ORD_QUANTITY_NEW"\],"rowId

    When the script is replayed, I'm not able to delete the item in shopping basket as it throws client error. see the snapshot attached

    The same step I've recorded and replayed in Loadrunner and it is replaying well. see the LR request below:

    web_custom_request("Send",
    "URL=http://se-ap00066.groupinfra.com/pmclient/BuyersToolsAjaxService.asmx/Send",
    "Method=POST",
    "TargetFrame=",
    "Resource=0",
    "RecContentType=application/json",
    "Referer=http://se-ap00066.groupinfra.com/pmclient/WebForms/Basket.aspx",
    "Snapshot=t5.inf",
    "Mode=HTML",
    "EncType=application/json; charset=utf-8",
    "Body={\"oId\":[\"{rowIdToDel}\",\"REMOVE_ROW\"],\"sValue\":\"\"}",
    LAST);


    Please can one give a solution to resolve this issue.

    Thanks,
    Nandini
    Attached Images Attached Images

  2. #2
    Member
    Join Date
    Oct 2009
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Jmeter custom request error

    I'm sure json style request work with JMeter, so let's first check what you're sending to the server.

    Is the correct value of rowIdToDel placed in the request? You can check the tab 'Request' to see what's sent to the server.
    - Did you escape the { at the start?
    - Why is there an extra ? in (.*?)
    - Did you encrypt the request?

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Jmeter custom request error

    Hi Joris,

    1. Correct value of rowIdToDel is placed in the request. I've cross verified it in "request" tab.Also I have copied pasted the Request below:

    POST http://se-ap00066.groupinfra.com/pmc...vice.asmx/Send

    POST data:
    {"oId":["690a2aa96dd946eabc2c","REMOVE_ROW"],"sValue":""}


    2. There is no need to escape the { at the start of regular expression extractor as I'm capturing a proper rowIdToDel value by using the left,right boundaries and regular expression (.*?) as mentioned in my mail above.

    See the "Response Data" I have got for Debug sampler I've added for Regular expression extractor 'rowIdToDel' below:

    rowIdToDel=690a2aa96dd946eabc2c
    rowIdToDel_g=1
    rowIdToDel_g0={"enableReceive":false,"enableSend": true,"fieldMapping":["690a2aa96dd946eabc2c","REMOVE_ROW"],"rowId
    rowIdToDel_g1=690a2aa96dd946eabc2c

    3. Without the ?, the .* would continue past the first " until it found the last possible " probably not what was intended. I guess there is no harm in using ? as I'm capturing the dynamic value rowIdToDel properly with Regular expr (.*?)

    4. Can you explain what you meant by "encrypt the request". How to do it and where to do it. See the snapshot for the properties I've set/unset for the request /pmclient/BuyersToolsAjaxService.asmx/Send ans also for HTTP Header Manager.

  4. #4
    Junior Member
    Join Date
    Jan 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Jmeter custom request error

    Sorry.... I forgot to attach the snapshot in my previous reply...Kindly see the snapshots attached in this reply
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Oct 2009
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Jmeter custom request error

    About #4; 'encrypt', I mean 'encode the parameters'. This might be the problem, according to the first snapshot in the .doc file it's disabled. Enable it by going to the request where you send {"oId":["${rowIdToDel}","REMOVE_ROW"],"sValue":""}. Enable the checkbox 'Encode?'. The Json requests I send are all encoded.

    If that doesn't work, try recording it using the JMeter 'HTTP Proxy Server', if you didn't already. I see you're using Badboy.

  6. #6
    Junior Member
    Join Date
    Jan 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Jmeter custom request error

    At last I was able to resolve the issue:-)

    Even if I record the requests using Jmeter 'HTTP Proxy Server', the checkbox 'Encode' is disabled for the request {"oId":["${rowIdToDel}","REMOVE_ROW"],"sValue":""}.

    In any case if I check the 'Encode" check box, the request fails. as it sends the request in diffferent mode with % symbols in the request.

    The solution is: Set the MIME type as 'application/json' and File path as '/pmclient/BuyersToolsAjaxService.asmx/'for the request {"oId":["${rowIdToDel}","REMOVE_ROW"],"sValue":""}.
    and it worked and the item got deleted from shpooing basket.

    Thanks for the suggestions

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:10 PM.

Copyright BetaSoft Inc.