SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Super Member
    Join Date
    Sep 2007
    Location
    Chennai, Tamil nadu, India
    Posts
    1,003
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Debug sampler - remove duplicate or unwanted matches

    Hi, i am using Debug sampler for debugging. More than 300 parameters and correlated values in the script. Each variable loading with actual value and possible available matches.So its difficult to track the values extracted by Regular Expression or JSON extractor.

    RequestVerificationToken=yi_gavnIRr61I1W-i70gshj7Gv9AYUzbnZdxXs69aGCIXUhIgDjkDTtzneYfQoa7p-ZXpE_bsczOWoKPV-TuGWDHl8Q1
    RequestVerificationToken_g=1
    RequestVerificationToken_g0=__RequestVerificationT oken" type="hidden" value="yi_gavnIRr61I1W-i70gshj7Gv9AYUzbnZdxXs69aGCIXUhIgDjkDTtzneYfQoa7p-ZXpE_bsczOWoKPV-TuGWDHl8Q1"
    RequestVerificationToken_g1=yi_gavnIRr61I1W-i70gshj7Gv9AYUzbnZdxXs69aGCIXUhIgDjkDTtzneYfQoa7p-ZXpE_bsczOWoKPV-TuGWDHl8Q1

    I need RequestVerificationToken value only in the response not RequestVerificationToken_g, RequestVerificationToken_g0, RequestVerificationToken_g1

    Is there any way available to remove the unwanted extra matches value?
    i have never seen bugs sleeping

  2. #2
    Member
    Join Date
    Oct 2013
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    It isn't something you can configure or amend, however if you don't need these matches you can use some scripting to remove these variables to make your analysis process easier.

    1. Add JSR223 Sampler before your Debug Sampler
    2. Make sure "groovy" is selected in the Language dropdown
    3. Put the following code into "Script" area


    Code:
    import org.apache.jmeter.threads.JMeterVariables; 
    
    JMeterVariables tempVars = new JMeterVariables()
     
    vars.entrySet().each { entry -> 
    def name = entry.getKey()
        if (!name.contains("_g")) {
            tempVars.put(name, entry.getValue() as String)                            
        }
    }
     
    ctx.setVariables(tempVars);
    The above code will remove all the variables having _g characters in names from JMeter so you won't see them in the Debug Sampler.

    See Groovy Is the New Black article for more details on using scripting to enhance JMeter tests.

  3. #3
    Super Member
    Join Date
    Sep 2007
    Location
    Chennai, Tamil nadu, India
    Posts
    1,003
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Thanks mate... Its working fine.
    i have never seen bugs sleeping

 

 

Tags for this Thread

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 © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:44 AM.

Copyright BetaSoft Inc.