You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Ayan <ra...@yahoo.co.in> on 2015/05/12 11:03:42 UTC

how to update new ip address in jmeter after recording

Hi,

I have recorded script in QA environment in a IP but I need to test it in
another IP (UAT environment). As all the HTTP request having IP address of
QA env, I need to change all the same.

Is there any way by which I need to change it only one place?

Thanks




--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-update-new-ip-address-in-jmeter-after-recording-tp5722417.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: how to update new ip address in jmeter after recording

Posted by hades <m....@gmail.com>.
Edit the JMX file in Notepad++ search ur Ipaddress and replace with a
variable name like ${ipaddress} and then replace all at once. and add this
variable in user defined variables from next time you dont need to edit the
script you just need to change in the user defined variables.

Note: Just take a backup off the script before replace just to make sure you
have a unchanged version.


Thanks
Hades



--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-update-new-ip-address-in-jmeter-after-recording-tp5722417p5722418.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: how to update new ip address in jmeter after recording

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 12.05.2015 um 11:03 schrieb Ayan:
> Hi,
>
> I have recorded script in QA environment in a IP but I need to test it in
> another IP (UAT environment). As all the HTTP request having IP address of
> QA env, I need to change all the same.
>
> Is there any way by which I need to change it only one place?
When you have defined a "user defined variable" while recording which 
has the IP address as a value, JMeter will put the name of that value 
surrounded by ${ and } wherever it finds it instead.

That way, you can record your script against one server and point it to 
another server by changing the value of that variable.

You can read more about it under "User defined Variable replacement" at 
http://jmeter.apache.org/usermanual/component_reference.html#HTTP%28S%29_Test_Script_Recorder

Regards
  Felix
>
> Thanks
>
>
>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/how-to-update-new-ip-address-in-jmeter-after-recording-tp5722417.html
> Sent from the JMeter - Dev mailing list archive at Nabble.com.


Re: how to update new ip address in jmeter after recording

Posted by Ayan <ra...@yahoo.co.in>.
Thanks,

I found another way like replace with jmeter property and while opening
jmeter open with the property value.

ex:
in http request default use  ${__P(group1.host)} 

go to command prompt and go to the path of bin folder.
run below command

jmeter –Jgroup1.host=test.com

all http request will run at test.com domain.



--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-update-new-ip-address-in-jmeter-after-recording-tp5722417p5722423.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: how to update new ip address in jmeter after recording

Posted by "glinius@live.com" <gl...@live.com>.
If it is a once-only action - JMeter .jmx files are basically .xml so you can
use your favorite text editor to find and replace all occurrences of "old"
IP with the "new" one. 

Going forward I would recommend using  HTTP Request Defaults
<http://blazemeter.com/blog/http-request-defaults>   to avoid this and
similar situations in the future so you could have a single config element
to alter all the HTTP Request Samplers as required.  



--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-update-new-ip-address-in-jmeter-after-recording-tp5722417p5722421.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.