Not as far as I know. [Although you might be able could use a BeanShell sampler in a Once-Only Controller to set the property, this would be a bit messy.]
One way to do this is to use a variable ${contextRoot} instead of a function call, and then define the variable "contextRoot" on the test plan screen, which is easy to edit. e.g. Name: Value: contextRoot /abcd/defg/ If you want to be able to override the property on the command line, you will need to use the User Parameters pre-processor: Either: Name: Value: contextRoot ${__P(contextRoot,/abcd/defg/)} which is a bit awkward to edit, or Name: Value: defaultRoot /abcd/defg/ (users change this line only) contextRoot ${__P(contextRoot,${defaultRoot})} should work. S. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:55 To: [EMAIL PROTECTED] Subject: RE: How to change context root in generic manner? Is there a way to do this from within the gui? We have some unsavy users. -----Original Message----- From: BAZLEY, Sebastian [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:24 AM To: 'JMeter Users List' Subject: RE: How to change context root in generic manner? Command line options are equally valid for the GUI, for example: jmeter -JcontextRoot=/abcd/efgh/ You can even use -t testfiles/test.jmx to preload a test script. [Or you can put the definition in jmeter.properties] S. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:12 To: [EMAIL PROTECTED] Subject: RE: How to change context root in generic manner? Got this working. Thanks! Now I have a few more problems. How do I run the app in the GUI? I can't seem to replace the variable $(__property(contextRoot)} which is everywhere. On a similar note, I added this variable to the HTTP Request Defaults. It works great when I call it from the command line or ant. I wanted it to work in the gui or from the command line as well. Im trying to set this up for others to where they can just use the gui to record their scripts and copy the recorded HTTP Requests to their section of the test plan without having to rename variables to actual server/port names, etc. thanks, Mike -----Original Message----- From: Jordi Salvat i Alabart [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 1:08 PM To: JMeter Users List Subject: Re: How to change context root in generic manner? Clink on your Test Plan component. You'll see a table with two columns. Enter "yourVariable" without the quotes in the first column, first row. Enter "/yourcurrentprefix" without the quotes in the 2nd column, first row. Record your script as usual and you'll see the replacement made. If you then change the 2nd column, first row, to "/yourotherprefix", you'll be hitting your other application. Hope it makes sense. I'm of course assuming you have a reasonably recent version of JMeter -- try with 1.9.1 if it doesn't work. If it still doesn't work, try with a nightly build. The docs are updated to explain this, in there. -- Salut, Jordi. En/na [EMAIL PROTECTED] ha escrit: > How do I do this? I don't see anywhere to add this? > And in the test plan I have /application/... in every path for every HTTP > Request. This will need to be changed often. > Do I change every path in every HTTP Request to have ${yourVariable}/... ? > Where do I defined this variable so that it can be easily changed for a test > on a different context-root? > thx, > Mike > > -----Original Message----- > From: Jordi Salvat i Alabart [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 06, 2004 11:13 AM > To: JMeter Users List > Subject: Re: How to change context root in generic manner? > > > Unfortunately, the HTTP Request Defaults component can't serve that > function. > > But you can define a variable in your test plan having the value > "/application". The proxy recorder will replace every occurence of > "/application" with "${yourVariable}". You'll only need to change the > variable to run with a different context root. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Note: The information contained in this email and in any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. The recipient should check this email and any attachments for the presence of viruses. Sender accepts no liability for any damages caused by any virus transmitted by this email. If you have received this email in error, please notify us immediately by replying to the message and delete the email from your computer. This e-mail is and any response to it will be unencrypted and, therefore, potentially unsecure. Thank you. NOVA Information Systems, Inc. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Note: The information contained in this email and in any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. The recipient should check this email and any attachments for the presence of viruses. Sender accepts no liability for any damages caused by any virus transmitted by this email. If you have received this email in error, please notify us immediately by replying to the message and delete the email from your computer. This e-mail is and any response to it will be unencrypted and, therefore, potentially unsecure. Thank you. NOVA Information Systems, Inc. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]