Bug 54525 - Search Feature : Enhance it with ability to replace
Summary: Search Feature : Enhance it with ability to replace
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.9
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2013-02-05 13:34 UTC by oliver lloyd
Modified: 2018-03-29 18:10 UTC (History)
1 user (show)



Attachments
Patch implementing the replace for Samplers (15.91 KB, patch)
2016-12-21 12:55 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description oliver lloyd 2013-02-05 13:34:23 UTC
The ability to search and replace when creating new variables would be very useful. 

Essentially what I do at the moment is create the variable, close the testplan and then use sed to find some string, say 'mysername.com', and replace it with '${server}'. This process works but it's slow and it would be a substantial enhancement if this were possible in the GUI - maybe via the Seach menu. It would be an even greater enhancement if there were a button available on the User Defined Variables form that would allow me to directly:

"Find any occurrences of the [MYVALUE] string and replace with '${[MYVARNAME]}'".

The added benefit here is saving the time, risk and effort of having to go through the plan and complete this process manually. 

It's worth noting that in pretty much every single case where a var is created then this find and replace action is required, so it may as well be made easier.

Relates to https://issues.apache.org/bugzilla/show_bug.cgi?id=22076.
Comment 1 Philippe Mouawad 2016-12-21 12:55:25 UTC
Created attachment 34541 [details]
Patch implementing the replace for Samplers

Hello,
This is a first step to replace feature.

Current patch has one bug for now that I didn't resolve yet (ideas welcome).
Bug is : If a sampler that contains a value to be replaced, the replacement does not occur although the underlying sampler has been. But value is not changed in JSyntaxtTextArea which leads it to be then reset to non replaced value. Otherwise replacement works fine for all other elements.
Comment 2 Philippe Mouawad 2016-12-22 20:39:23 UTC
Author: pmouawad
Date: Thu Dec 22 20:38:50 2016
New Revision: 1775729

URL: http://svn.apache.org/viewvc?rev=1775729&view=rev
Log:
Bug 54525 - Search Feature : Enhance it with ability to replace
Implement feature for Sampler subclasses
Bugzilla Id: 54525

Added:
    jmeter/trunk/src/core/org/apache/jmeter/gui/Replaceable.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Comment 3 Philippe Mouawad 2017-02-02 22:12:04 UTC
Author: pmouawad
Date: Thu Feb  2 22:10:45 2017
New Revision: 1781476

URL: http://svn.apache.org/viewvc?rev=1781476&view=rev
Log:
Bug 54525 Search Feature : Enhance it with ability to replace
Bugzilla Id: 54525

Added:
    jmeter/trunk/test/src/org/apache/jmeter/testelement/TestHeaderManager.java   (with props)
Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java
Comment 4 Philippe Mouawad 2017-02-07 12:14:26 UTC
Author: pmouawad
Date: Tue Feb  7 12:11:25 2017
New Revision: 1781992

URL: http://svn.apache.org/viewvc?rev=1781992&view=rev
Log:
Bug 54525 Search Feature : Enhance it with ability to replace
Improve rendering and add i18n for message
Bugzilla Id: 54525

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
Comment 5 Philippe Mouawad 2017-02-23 12:17:14 UTC
Author: pmouawad
Date: Thu Feb 23 12:16:30 2017
New Revision: 1784115

URL: http://svn.apache.org/viewvc?rev=1784115&view=rev
Log:
Bug 54525 Search Feature : Enhance it with ability to replace
Bugzilla Id: 54525

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Comment 6 The ASF infrastructure team 2022-09-24 20:37:53 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3052