You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by be...@hsbcib.com on 2010/04/13 11:49:58 UTC

User defined variables

All

Could how do I get my sampler to access user defined variables. When I set
a UDV Config element inside my ThreadGroup and put ${SERVER} in one of the
text fields in my SamplerGUI
the sample gui just puts ${SERVER} in the Sampler variable. Am I missing
something. Is there an example Sampler one could use.




-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by be...@hsbcib.com.
Hi Sorry about the attachments. Sorry what is the debug sampler?


Regards


                                                                           
             sebb                                                          
             <se...@gmail.com>                                            
                                                                        To 
             Apr 14 2010 10:33          JMeter Users List                  
                                        <jm...@jakarta.apache.org>   
             Mail Size: 19074                                           cc 
                                                                           
                                                                   Subject 
                                        Re: User defined variables         
             Please respond to                                             
               "JMeter Users                                               
                   List"                                            Entity 
             <jmeter-user@jakar                                            
               ta.apache.org>                                              
                                                                           
                                                                           




On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
> Hi Sebb
>
>  I have attached screenshots of my test plan. When the test starts the
>  following logging statement has been placed in the sampler. But the host
>  values does not get populated
>  with what is defined in the UDV.

Did you try using a Debug Sampler?

Please don't send attachments to the list - they are too heavy and
tend to fall off ;-)

Upload them somewhere public and post the URL instead.

>  010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Running
the
>  test!
>  2010/04/14 09:54:02 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning
>  (true,*local*)
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Starting
1
>  threads for group Thread Group. Ramp up = 50.
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Test
will
>  stop on error
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: All
threads
>  have been started
>  2010/04/14 09:54:02 INFO  - jmeter.threads.JMeterThread: Thread started:
>  Thread Group 1-1
>  2010/04/14 09:54:03 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  2010/04/14 09:54:04 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  2010/04/14 09:54:05 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>
>
>  (Embedded image moved to file: pic19853.gif)
>
>
>  (Embedded image moved to file: pic29034.gif)
>
>
>
>
>  Regards
>
>
>
>
>
>  __________________________________________________________
>
>
>
>              Deepak Shetty
>              <shettyd@gmail.com
>              >
To
>                                         JMeter Users List
>
>              Apr 13 2010 18:07          <jm...@jakarta.apache.org>
>
cc
>              Mail Size: 13872
>
>
Subject
>                                         Re: User defined variables
>
>              Please respond to
>
>                "JMeter Users
Entity
>
>                    List"
>              <jmeter-user@jakar
>                ta.apache.org>
>
>
>
>
>
>
>  Hi
>  I dont know much about the samplers so youll probably have to wait for
sebb
>  to reply.
>  However User defined variables apply at runtime. Whereas you seem to be
>  asking about load and store from the JMX file (in which case ${SERVER}
is
>  correct , the value will get replaced at runtime
>  regards
>  deepak
>
>  On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:
>
>  > Yes sorry.
>  >
>  > So I have a sample that looks like
>  >
>  > public class TestSampler extends AbstractSampler implements
TestListener
>  {
>  >
>  >  public final static String HOST = "TestSampler.remoteHost";
>  >
>  >
>  >   public final void setHost(String newServer) {
>  >            this.setProperty(HOST, newServer);
>  >   }
>  >
>  >   public final String getHost() {
>  >            return getPropertyAsString(HOST);
>  >   }
>  > }
>  >
>  > Now I would like to set this values based on a user defined variable
>  config
>  > above this sampler.
>  > So in my GUI config class for this sampler I have
>  >
>  >
>  > public class TestSamplerGui extends AbstractSamplerGui implements
>  > ActionListener, ChangeListener {
>  >
>  >   private final JLabeledTextField remoteHost = new JLabeledTextField(
>  > "Remote host"); //$NON-NLS-1$
>  >
>  >        @Override
>  >   protected void configureTestElement(TestElement mc) {
>  >           remoteHost.setText(mc.getPropertyAsString
(TestSampler.HOST));
>  >        }
>  >
>  >
>  >    public TestElement createTestElement() {
>  >        TestSampler  sampler = new TestSampler ();
>  >        modifyTestElement(sampler);
>  >
>  >        return sampler;
>  >    }
>  >
>  >
>  >        public void modifyTestElement(TestElement s) {
>  >      TestSamplerGui sampler = (TestSamplerGui ) s;
>  >      this.configureTestElement(sampler);
>  >      sampler.setProperty
(FIXProtocolMessageSampler.HOST,this.remoteHost
>  > .getText());
>  >         }
>  > }
>  >
>  > So the first time if you set the value for remote host on the front
end
>  > within the sampler gui it writes it to the .xml file. But when you
load
>  it
>  > again
>  > and try and update the host it just pulls the old value back because
of
>  the
>  > configureTestElement() method.
>  >
>  > This was copied from the FTPSampler on trunk
>  >
>  >
>  > Regards
>  >
>  >
>  > Ben CUTHBERT
>  >
>  >
>  > Futures and Options
>  > 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>  >
>  >
>  > __________________________________________________________
>  >
>  >
>  > Phone.     +44 (0) 20 799 22192
>  >
>  >
>  > Email.       ben.cuthbert@hsbcib.com
>  >
>  >
>  > __________________________________________________________
>  >
>  >
>  >
>  >             Deepak Shetty
>  >             <shettyd@gmail.com
>  >             >
To
>  >                                        JMeter Users List
>  >              Apr 13 2010 17:11
<jm...@jakarta.apache.org>
>  >
cc
>  >             Mail Size: 9388
>  >
>  Subject
>  >                                        Re: User defined variables
>  >
>  >             Please respond to
>  >               "JMeter Users
>  >                   List"
>  >             <jmeter-user@jakar
>  >               ta.apache.org>
>  >
>  >
>  >
>  >
>  >
>  >
>  > Sorry I think i misunderstood your question.
>  > You are writing a custom sampler and you have defined a field in it
and
>  you
>  > want to pass in a variable?
>  >
>  > regards
>  > deepak
>  >
>  > On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>  >
>  > > I think it is something in the GUI Config class.
>  > >
>  > > Is there a template anywhere that I can base my GUI code off?
>  > > Regards
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > __________________________________________________________
>  > >
>  > >
>  > >
>  > >             Deepak Shetty
>  > >             <shettyd@gmail.com
>  > >             >
>  To
>  > >                                        JMeter Users List
>  > >             Apr 13 2010 16:55
<jm...@jakarta.apache.org>
>  > >
>  cc
>  > >             Mail Size: 7046
>  > >
>  Subject
>  > >                                        Re: User defined variables
>  > >
>  > >             Please respond to
>  > >               "JMeter Users
>  > >                   List"
>  > >             <jmeter-user@jakar
>  > >               ta.apache.org>
>  > >
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > should have worked . There might be a case mismatch or whitespace or
>  > > something in the UDV. if you have verified that then what is your
exact
>  > > Test
>  > > Structure and definition?(also did you get any errors in jmeter.log)
>  > >
>  > > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>  > >
>  > > >
>  > > > All
>  > > >
>  > > > Could how do I get my sampler to access user defined variables.
When
>  I
>  > > set
>  > > > a UDV Config element inside my ThreadGroup and put ${SERVER} in
one
>  of
>  > > the
>  > > > text fields in my SamplerGUI
>  > > > the sample gui just puts ${SERVER} in the Sampler variable. Am I
>  > missing
>  > > > something. Is there an example Sampler one could use.
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > -----------------------------------------
>  > > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  > > >
>  > > > This transmission has been issued by a member of the HSBC Group
>  > > > "HSBC" for the information of the addressee only and should not be
>  > > > reproduced and/or distributed to any other person. Each page
>  > > > attached hereto must be read in conjunction with any disclaimer
>  > > > which forms part of it. Unless otherwise stated, this transmission
>  > > > is neither an offer nor the solicitation of an offer to sell or
>  > > > purchase any investment. Its contents are based on information
>  > > > obtained from sources believed to be reliable but HSBC makes no
>  > > > representation and accepts no responsibility or liability as to
its
>  > > > completeness or accuracy.
>  > > >
>  > > >
---------------------------------------------------------------------
>  > > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > > > For additional commands, e-mail:
jmeter-user-help@jakarta.apache.org
>  > > >
>  > > >
>  > >
>  > >
>  > > -----------------------------------------
>  > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  > >
>  > > This transmission has been issued by a member of the HSBC Group
>  > > "HSBC" for the information of the addressee only and should not be
>  > > reproduced and/or distributed to any other person. Each page
>  > > attached hereto must be read in conjunction with any disclaimer
>  > > which forms part of it. Unless otherwise stated, this transmission
>  > > is neither an offer nor the solicitation of an offer to sell or
>  > > purchase any investment. Its contents are based on information
>  > > obtained from sources believed to be reliable but HSBC makes no
>  > > representation and accepts no responsibility or liability as to its
>  > > completeness or accuracy.
>  > >
>  > >
---------------------------------------------------------------------
>  > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  > >
>  > >
>  >
>  >
>  > -----------------------------------------
>  > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >
>  > This transmission has been issued by a member of the HSBC Group
>  > "HSBC" for the information of the addressee only and should not be
>  > reproduced and/or distributed to any other person. Each page
>  > attached hereto must be read in conjunction with any disclaimer
>  > which forms part of it. Unless otherwise stated, this transmission
>  > is neither an offer nor the solicitation of an offer to sell or
>  > purchase any investment. Its contents are based on information
>  > obtained from sources believed to be reliable but HSBC makes no
>  > representation and accepts no responsibility or liability as to its
>  > completeness or accuracy.
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>  >
>
>
>
>
> ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts
for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to
its
>  own proprietary book or with an associate of HSBC Group. This represents
a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to
the
>  corporate finance client about the valuation and pricing of the offering
as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>
>  -----------------------------------------
>  SAVE PAPER - THINK BEFORE YOU PRINT!
>
>  This transmission has been issued by a member of the HSBC Group
>  "HSBC" for the information of the addressee only and should not be
>  reproduced and/or distributed to any other person. Each page
>  attached hereto must be read in conjunction with any disclaimer
>  which forms part of it. Unless otherwise stated, this transmission
>  is neither an offer nor the solicitation of an offer to sell or
>  purchase any investment. Its contents are based on information
>  obtained from sources believed to be reliable but HSBC makes no
>  representation and accepts no responsibility or liability as to its
>  completeness or accuracy.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org




************************************************************
HSBC Bank plc may be solicited in the course of its placement efforts for a
new issue, by investment clients of the firm for whom the Bank as a firm
already provides other services. It may equally decide to allocate to its
own proprietary book or with an associate of HSBC Group. This represents a
potential conflict of interest. HSBC Bank plc has internal arrangements
designed to ensure that the firm would give unbiased and full advice to the
corporate finance client about the valuation and pricing of the offering as
well as internal systems, controls and procedures to identify and manage
conflicts of interest.

HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
Registered in England - Number 14259
Authorised and regulated by the Financial Services Authority.
************************************************************

-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by be...@hsbcib.com.
Thanks I will take a look.

I did notice something yesterday when trying to run the JMeter-server my
code had loads of null pointers on the server.log.
When it runs on my local machine in GUI mode everything is fine. Is there
some important document that outlines building load tests for distributed
mode?






                                                                           
             sebb                                                          
             <se...@gmail.com>                                            
                                                                        To 
             Apr 15 2010 00:24          JMeter Users List                  
                                        <jm...@jakarta.apache.org>   
             Mail Size: 25545                                           cc 
                                                                           
                                                                   Subject 
                                        Re: User defined variables         
             Please respond to                                             
               "JMeter Users                                               
                   List"                                            Entity 
             <jmeter-user@jakar                                            
               ta.apache.org>                                              
                                                                           
                                                                           




Have a look at the examples section of the source tree.

On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
> Sebb
>
>  I have a question. I want to set my own sample time. I am sending out a
>  message to a remote system and waiting for the Ack to come back. In a
>  session class
>  i set the System.nanoTime() on the way out and then when we receive the
>  incoming response. How can I set this on the sample? as the setTime is
>  deprecated.
>
>
>
>
>
>  __________________________________________________________
>
>
>
>              Ben
>              CUTHBERT/IBEU/HSB
>              C
To
>                                        "JMeter Users List"
>              Apr 14 2010 10:37         <jm...@jakarta.apache.org>
>
cc
>              Phone no. 22200           JMeter Users List
>              44 0 44 20 799            <jm...@jakarta.apache.org>
>              22192
Subject
>              Mail Size: 20586          Re: User defined variables
(Document
>                                        link: Ben CUTHBERT)
>
>
>
Entity
>
>
>
>
>
>
>
>  Hi Sorry about the attachments. Sorry what is the debug sampler?
>
>
>  Regards
>
>
>
>
>              sebb
>              <se...@gmail.com>
>
To
>              Apr 14 2010 10:33          JMeter Users List
>                                         <jm...@jakarta.apache.org>
>              Mail Size: 19074
cc
>
>
>
Subject
>                                         Re: User defined variables
>              Please respond to
>                "JMeter Users
>
>                    List"
Entity
>
>              <jmeter-user@jakar
>                ta.apache.org>
>
>
>
>
>
>
>  On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
>  > Hi Sebb
>  >
>  >  I have attached screenshots of my test plan. When the test starts the
>  >  following logging statement has been placed in the sampler. But the
host
>  >  values does not get populated
>  >  with what is defined in the UDV.
>
>  Did you try using a Debug Sampler?
>
>  Please don't send attachments to the list - they are too heavy and
>  tend to fall off ;-)
>
>  Upload them somewhere public and post the URL instead.
>
>  >  010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine:
Running
>  the
>  >  test!
>  >  2010/04/14 09:54:02 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning
>  >  (true,*local*)
>  >  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine:
Starting
>  1
>  >  threads for group Thread Group. Ramp up = 50.
>  >  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Test
>  will
>  >  stop on error
>  >  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: All
>  threads
>  >  have been started
>  >  2010/04/14 09:54:02 INFO  - jmeter.threads.JMeterThread: Thread
started:
>  >  Thread Group 1-1
>  >  2010/04/14 09:54:03 INFO  -
>  >  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  >  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  >  2010/04/14 09:54:04 INFO  -
>  >  com.hsbc.jmeter.protocol.test.samplerTestSampler Starting sampler
>  >  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  >  2010/04/14 09:54:05 INFO  -
>  >  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  >  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  >
>  >
>  >  (Embedded image moved to file: pic19853.gif)
>  >
>  >
>  >  (Embedded image moved to file: pic29034.gif)
>  >
>  >
>  >
>  >
>  >  Regards
>  >
>  >
>  >
>  >
>  >
>  >  __________________________________________________________
>  >
>  >
>  >
>  >              Deepak Shetty
>  >              <shettyd@gmail.com
>  >              >
>  To
>  >                                         JMeter Users List
>  >
>  >              Apr 13 2010 18:07
<jm...@jakarta.apache.org>
>  >
>  cc
>  >              Mail Size: 13872
>  >
>  >
>  Subject
>  >                                         Re: User defined variables
>  >
>  >              Please respond to
>  >
>  >                "JMeter Users
>  Entity
>  >
>  >                    List"
>  >              <jmeter-user@jakar
>  >                ta.apache.org>
>  >
>  >
>  >
>  >
>  >
>  >
>  >  Hi
>  >  I dont know much about the samplers so youll probably have to wait
for
>  sebb
>  >  to reply.
>  >  However User defined variables apply at runtime. Whereas you seem to
be
>  >  asking about load and store from the JMX file (in which case $
{SERVER}
>  is
>  >  correct , the value will get replaced at runtime
>  >  regards
>  >  deepak
>  >
>  >  On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:
>  >
>  >  > Yes sorry.
>  >  >
>  >  > So I have a sample that looks like
>  >  >
>  >  > public class TestSampler extends AbstractSampler implements
>  TestListener
>  >  {
>  >  >
>  >  >  public final static String HOST = "TestSampler.remoteHost";
>  >  >
>  >  >
>  >  >   public final void setHost(String newServer) {
>  >  >            this.setProperty(HOST, newServer);
>  >  >   }
>  >  >
>  >  >   public final String getHost() {
>  >  >            return getPropertyAsString(HOST);
>  >  >   }
>  >  > }
>  >  >
>  >  > Now I would like to set this values based on a user defined
variable
>  >  config
>  >  > above this sampler.
>  >  > So in my GUI config class for this sampler I have
>  >  >
>  >  >
>  >  > public class TestSamplerGui extends AbstractSamplerGui implements
>  >  > ActionListener, ChangeListener {
>  >  >
>  >  >   private final JLabeledTextField remoteHost = new
JLabeledTextField(
>  >  > "Remote host"); //$NON-NLS-1$
>  >  >
>  >  >        @Override
>  >  >   protected void configureTestElement(TestElement mc) {
>  >  >           remoteHost.setText(mc.getPropertyAsString
>  (TestSampler.HOST));
>  >  >        }
>  >  >
>  >  >
>  >  >    public TestElement createTestElement() {
>  >  >        TestSampler  sampler = new TestSampler ();
>  >  >        modifyTestElement(sampler);
>  >  >
>  >  >        return sampler;
>  >  >    }
>  >  >
>  >  >
>  >  >        public void modifyTestElement(TestElement s) {
>  >  >      TestSamplerGui sampler = (TestSamplerGui ) s;
>  >  >      this.configureTestElement(sampler);
>  >  >      sampler.setProperty
>  (FIXProtocolMessageSampler.HOST,this.remoteHost
>  >  > .getText());
>  >  >         }
>  >  > }
>  >  >
>  >  > So the first time if you set the value for remote host on the front
>  end
>  >  > within the sampler gui it writes it to the .xml file. But when you
>  load
>  >  it
>  >  > again
>  >  > and try and update the host it just pulls the old value back
because
>  of
>  >  the
>  >  > configureTestElement() method.
>  >  >
>  >  > This was copied from the FTPSampler on trunk
>  >  >
>  >  >
>  >  > Regards
>  >  >
>  >  >
>  >  > Ben CUTHBERT
>  >  >
>  >  >
>  >  > Futures and Options
>  >  > 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>  >  >
>  >  >
>  >  > __________________________________________________________
>  >  >
>  >  >
>  >  > Phone.     +44 (0) 20 799 22192
>  >  >
>  >  >
>  >  > Email.       ben.cuthbert@hsbcib.com
>  >  >
>  >  >
>  >  > __________________________________________________________
>  >  >
>  >  >
>  >  >
>  >  >             Deepak Shetty
>  >  >             <shettyd@gmail.com
>  >  >             >
>  To
>  >  >                                        JMeter Users List
>  >  >              Apr 13 2010 17:11
>  <jm...@jakarta.apache.org>
>  >  >
>  cc
>  >  >             Mail Size: 9388
>  >  >
>  >  Subject
>  >  >                                        Re: User defined variables
>  >  >
>  >  >             Please respond to
>  >  >               "JMeter Users
>  >  >                   List"
>  >  >             <jmeter-user@jakar
>  >  >               ta.apache.org>
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  > Sorry I think i misunderstood your question.
>  >  > You are writing a custom sampler and you have defined a field in it
>  and
>  >  you
>  >  > want to pass in a variable?
>  >  >
>  >  > regards
>  >  > deepak
>  >  >
>  >  > On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>  >  >
>  >  > > I think it is something in the GUI Config class.
>  >  > >
>  >  > > Is there a template anywhere that I can base my GUI code off?
>  >  > > Regards
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > > __________________________________________________________
>  >  > >
>  >  > >
>  >  > >
>  >  > >             Deepak Shetty
>  >  > >             <shettyd@gmail.com
>  >  > >             >
>  >  To
>  >  > >                                        JMeter Users List
>  >  > >             Apr 13 2010 16:55
>  <jm...@jakarta.apache.org>
>  >  > >
>  >  cc
>  >  > >             Mail Size: 7046
>  >  > >
>  >  Subject
>  >  > >                                        Re: User defined variables
>  >  > >
>  >  > >             Please respond to
>  >  > >               "JMeter Users
>  >  > >                   List"
>  >  > >             <jmeter-user@jakar
>  >  > >               ta.apache.org>
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > > should have worked . There might be a case mismatch or whitespace
or
>  >  > > something in the UDV. if you have verified that then what is your
>  exact
>  >  > > Test
>  >  > > Structure and definition?(also did you get any errors in
jmeter.log)
>  >  > >
>  >  > > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>  >  > >
>  >  > > >
>  >  > > > All
>  >  > > >
>  >  > > > Could how do I get my sampler to access user defined variables.
>  When
>  >  I
>  >  > > set
>  >  > > > a UDV Config element inside my ThreadGroup and put ${SERVER} in
>  one
>  >  of
>  >  > > the
>  >  > > > text fields in my SamplerGUI
>  >  > > > the sample gui just puts ${SERVER} in the Sampler variable. Am
I
>  >  > missing
>  >  > > > something. Is there an example Sampler one could use.
>  >  > > >
>  >  > > >
>  >  > > >
>  >  > > >
>  >  > > > -----------------------------------------
>  >  > > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >  > > >
>  >  > > > This transmission has been issued by a member of the HSBC Group
>  >  > > > "HSBC" for the information of the addressee only and should not
be
>  >  > > > reproduced and/or distributed to any other person. Each page
>  >  > > > attached hereto must be read in conjunction with any disclaimer
>  >  > > > which forms part of it. Unless otherwise stated, this
transmission
>  >  > > > is neither an offer nor the solicitation of an offer to sell or
>  >  > > > purchase any investment. Its contents are based on information
>  >  > > > obtained from sources believed to be reliable but HSBC makes no
>  >  > > > representation and accepts no responsibility or liability as to
>  its
>  >  > > > completeness or accuracy.
>  >  > > >
>  >  > > >
>  ---------------------------------------------------------------------
>  >  > > > To unsubscribe, e-mail:
jmeter-user-unsubscribe@jakarta.apache.org
>  >  > > > For additional commands, e-mail:
>  jmeter-user-help@jakarta.apache.org
>  >  > > >
>  >  > > >
>  >  > >
>  >  > >
>  >  > > -----------------------------------------
>  >  > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >  > >
>  >  > > This transmission has been issued by a member of the HSBC Group
>  >  > > "HSBC" for the information of the addressee only and should not
be
>  >  > > reproduced and/or distributed to any other person. Each page
>  >  > > attached hereto must be read in conjunction with any disclaimer
>  >  > > which forms part of it. Unless otherwise stated, this
transmission
>  >  > > is neither an offer nor the solicitation of an offer to sell or
>  >  > > purchase any investment. Its contents are based on information
>  >  > > obtained from sources believed to be reliable but HSBC makes no
>  >  > > representation and accepts no responsibility or liability as to
its
>  >  > > completeness or accuracy.
>  >  > >
>  >  > >
>  ---------------------------------------------------------------------
>  >  > > To unsubscribe, e-mail:
jmeter-user-unsubscribe@jakarta.apache.org
>  >  > > For additional commands, e-mail:
jmeter-user-help@jakarta.apache.org
>  >  > >
>  >  > >
>  >  >
>  >  >
>  >  > -----------------------------------------
>  >  > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >  >
>  >  > This transmission has been issued by a member of the HSBC Group
>  >  > "HSBC" for the information of the addressee only and should not be
>  >  > reproduced and/or distributed to any other person. Each page
>  >  > attached hereto must be read in conjunction with any disclaimer
>  >  > which forms part of it. Unless otherwise stated, this transmission
>  >  > is neither an offer nor the solicitation of an offer to sell or
>  >  > purchase any investment. Its contents are based on information
>  >  > obtained from sources believed to be reliable but HSBC makes no
>  >  > representation and accepts no responsibility or liability as to its
>  >  > completeness or accuracy.
>  >  >
>  >  >
---------------------------------------------------------------------
>  >  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  > For additional commands, e-mail:
jmeter-user-help@jakarta.apache.org
>  >  >
>  >  >
>  >
>  >
>  >
>  >
>  > ************************************************************
>  >  HSBC Bank plc may be solicited in the course of its placement efforts
>  for a
>  >  new issue, by investment clients of the firm for whom the Bank as a
firm
>  >  already provides other services. It may equally decide to allocate to
>  its
>  >  own proprietary book or with an associate of HSBC Group. This
represents
>  a
>  >  potential conflict of interest. HSBC Bank plc has internal
arrangements
>  >  designed to ensure that the firm would give unbiased and full advice
to
>  the
>  >  corporate finance client about the valuation and pricing of the
offering
>  as
>  >  well as internal systems, controls and procedures to identify and
manage
>  >  conflicts of interest.
>  >
>  >  HSBC Bank plc
>  >  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  >  Registered in England - Number 14259
>  >  Authorised and regulated by the Financial Services Authority.
>  >  ************************************************************
>  >
>  >
>  >  -----------------------------------------
>  >  SAVE PAPER - THINK BEFORE YOU PRINT!
>  >
>  >  This transmission has been issued by a member of the HSBC Group
>  >  "HSBC" for the information of the addressee only and should not be
>  >  reproduced and/or distributed to any other person. Each page
>  >  attached hereto must be read in conjunction with any disclaimer
>  >  which forms part of it. Unless otherwise stated, this transmission
>  >  is neither an offer nor the solicitation of an offer to sell or
>  >  purchase any investment. Its contents are based on information
>  >  obtained from sources believed to be reliable but HSBC makes no
>  >  representation and accepts no responsibility or liability as to its
>  >  completeness or accuracy.
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
>
>  ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts
for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to
its
>  own proprietary book or with an associate of HSBC Group. This represents
a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to
the
>  corporate finance client about the valuation and pricing of the offering
as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>
>  ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts
for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to
its
>  own proprietary book or with an associate of HSBC Group. This represents
a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to
the
>  corporate finance client about the valuation and pricing of the offering
as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>  -----------------------------------------
>  SAVE PAPER - THINK BEFORE YOU PRINT!
>
>  This transmission has been issued by a member of the HSBC Group
>  "HSBC" for the information of the addressee only and should not be
>  reproduced and/or distributed to any other person. Each page
>  attached hereto must be read in conjunction with any disclaimer
>  which forms part of it. Unless otherwise stated, this transmission
>  is neither an offer nor the solicitation of an offer to sell or
>  purchase any investment. Its contents are based on information
>  obtained from sources believed to be reliable but HSBC makes no
>  representation and accepts no responsibility or liability as to its
>  completeness or accuracy.
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org




************************************************************
HSBC Bank plc may be solicited in the course of its placement efforts for a
new issue, by investment clients of the firm for whom the Bank as a firm
already provides other services. It may equally decide to allocate to its
own proprietary book or with an associate of HSBC Group. This represents a
potential conflict of interest. HSBC Bank plc has internal arrangements
designed to ensure that the firm would give unbiased and full advice to the
corporate finance client about the valuation and pricing of the offering as
well as internal systems, controls and procedures to identify and manage
conflicts of interest.

HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
Registered in England - Number 14259
Authorised and regulated by the Financial Services Authority.
************************************************************

-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by sebb <se...@gmail.com>.
Have a look at the examples section of the source tree.

On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
> Sebb
>
>  I have a question. I want to set my own sample time. I am sending out a
>  message to a remote system and waiting for the Ack to come back. In a
>  session class
>  i set the System.nanoTime() on the way out and then when we receive the
>  incoming response. How can I set this on the sample? as the setTime is
>  deprecated.
>
>
>
>
>
>  __________________________________________________________
>
>
>
>              Ben
>              CUTHBERT/IBEU/HSB
>              C                                                          To
>                                        "JMeter Users List"
>              Apr 14 2010 10:37         <jm...@jakarta.apache.org>
>                                                                         cc
>              Phone no. 22200           JMeter Users List
>              44 0 44 20 799            <jm...@jakarta.apache.org>
>              22192                                                 Subject
>              Mail Size: 20586          Re: User defined variables(Document
>                                        link: Ben CUTHBERT)
>
>
>                                                                     Entity
>
>
>
>
>
>
>
>  Hi Sorry about the attachments. Sorry what is the debug sampler?
>
>
>  Regards
>
>
>
>
>              sebb
>              <se...@gmail.com>
>                                                                         To
>              Apr 14 2010 10:33          JMeter Users List
>                                         <jm...@jakarta.apache.org>
>              Mail Size: 19074                                           cc
>
>
>                                                                    Subject
>                                         Re: User defined variables
>              Please respond to
>                "JMeter Users
>
>                    List"                                            Entity
>
>              <jmeter-user@jakar
>                ta.apache.org>
>
>
>
>
>
>
>  On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
>  > Hi Sebb
>  >
>  >  I have attached screenshots of my test plan. When the test starts the
>  >  following logging statement has been placed in the sampler. But the host
>  >  values does not get populated
>  >  with what is defined in the UDV.
>
>  Did you try using a Debug Sampler?
>
>  Please don't send attachments to the list - they are too heavy and
>  tend to fall off ;-)
>
>  Upload them somewhere public and post the URL instead.
>
>  >  010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Running
>  the
>  >  test!
>  >  2010/04/14 09:54:02 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning
>  >  (true,*local*)
>  >  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Starting
>  1
>  >  threads for group Thread Group. Ramp up = 50.
>  >  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Test
>  will
>  >  stop on error
>  >  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: All
>  threads
>  >  have been started
>  >  2010/04/14 09:54:02 INFO  - jmeter.threads.JMeterThread: Thread started:
>  >  Thread Group 1-1
>  >  2010/04/14 09:54:03 INFO  -
>  >  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  >  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  >  2010/04/14 09:54:04 INFO  -
>  >  com.hsbc.jmeter.protocol.test.samplerTestSampler Starting sampler
>  >  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  >  2010/04/14 09:54:05 INFO  -
>  >  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  >  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  >
>  >
>  >  (Embedded image moved to file: pic19853.gif)
>  >
>  >
>  >  (Embedded image moved to file: pic29034.gif)
>  >
>  >
>  >
>  >
>  >  Regards
>  >
>  >
>  >
>  >
>  >
>  >  __________________________________________________________
>  >
>  >
>  >
>  >              Deepak Shetty
>  >              <shettyd@gmail.com
>  >              >
>  To
>  >                                         JMeter Users List
>  >
>  >              Apr 13 2010 18:07          <jm...@jakarta.apache.org>
>  >
>  cc
>  >              Mail Size: 13872
>  >
>  >
>  Subject
>  >                                         Re: User defined variables
>  >
>  >              Please respond to
>  >
>  >                "JMeter Users
>  Entity
>  >
>  >                    List"
>  >              <jmeter-user@jakar
>  >                ta.apache.org>
>  >
>  >
>  >
>  >
>  >
>  >
>  >  Hi
>  >  I dont know much about the samplers so youll probably have to wait for
>  sebb
>  >  to reply.
>  >  However User defined variables apply at runtime. Whereas you seem to be
>  >  asking about load and store from the JMX file (in which case ${SERVER}
>  is
>  >  correct , the value will get replaced at runtime
>  >  regards
>  >  deepak
>  >
>  >  On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:
>  >
>  >  > Yes sorry.
>  >  >
>  >  > So I have a sample that looks like
>  >  >
>  >  > public class TestSampler extends AbstractSampler implements
>  TestListener
>  >  {
>  >  >
>  >  >  public final static String HOST = "TestSampler.remoteHost";
>  >  >
>  >  >
>  >  >   public final void setHost(String newServer) {
>  >  >            this.setProperty(HOST, newServer);
>  >  >   }
>  >  >
>  >  >   public final String getHost() {
>  >  >            return getPropertyAsString(HOST);
>  >  >   }
>  >  > }
>  >  >
>  >  > Now I would like to set this values based on a user defined variable
>  >  config
>  >  > above this sampler.
>  >  > So in my GUI config class for this sampler I have
>  >  >
>  >  >
>  >  > public class TestSamplerGui extends AbstractSamplerGui implements
>  >  > ActionListener, ChangeListener {
>  >  >
>  >  >   private final JLabeledTextField remoteHost = new JLabeledTextField(
>  >  > "Remote host"); //$NON-NLS-1$
>  >  >
>  >  >        @Override
>  >  >   protected void configureTestElement(TestElement mc) {
>  >  >           remoteHost.setText(mc.getPropertyAsString
>  (TestSampler.HOST));
>  >  >        }
>  >  >
>  >  >
>  >  >    public TestElement createTestElement() {
>  >  >        TestSampler  sampler = new TestSampler ();
>  >  >        modifyTestElement(sampler);
>  >  >
>  >  >        return sampler;
>  >  >    }
>  >  >
>  >  >
>  >  >        public void modifyTestElement(TestElement s) {
>  >  >      TestSamplerGui sampler = (TestSamplerGui ) s;
>  >  >      this.configureTestElement(sampler);
>  >  >      sampler.setProperty
>  (FIXProtocolMessageSampler.HOST,this.remoteHost
>  >  > .getText());
>  >  >         }
>  >  > }
>  >  >
>  >  > So the first time if you set the value for remote host on the front
>  end
>  >  > within the sampler gui it writes it to the .xml file. But when you
>  load
>  >  it
>  >  > again
>  >  > and try and update the host it just pulls the old value back because
>  of
>  >  the
>  >  > configureTestElement() method.
>  >  >
>  >  > This was copied from the FTPSampler on trunk
>  >  >
>  >  >
>  >  > Regards
>  >  >
>  >  >
>  >  > Ben CUTHBERT
>  >  >
>  >  >
>  >  > Futures and Options
>  >  > 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>  >  >
>  >  >
>  >  > __________________________________________________________
>  >  >
>  >  >
>  >  > Phone.     +44 (0) 20 799 22192
>  >  >
>  >  >
>  >  > Email.       ben.cuthbert@hsbcib.com
>  >  >
>  >  >
>  >  > __________________________________________________________
>  >  >
>  >  >
>  >  >
>  >  >             Deepak Shetty
>  >  >             <shettyd@gmail.com
>  >  >             >
>  To
>  >  >                                        JMeter Users List
>  >  >              Apr 13 2010 17:11
>  <jm...@jakarta.apache.org>
>  >  >
>  cc
>  >  >             Mail Size: 9388
>  >  >
>  >  Subject
>  >  >                                        Re: User defined variables
>  >  >
>  >  >             Please respond to
>  >  >               "JMeter Users
>  >  >                   List"
>  >  >             <jmeter-user@jakar
>  >  >               ta.apache.org>
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  >
>  >  > Sorry I think i misunderstood your question.
>  >  > You are writing a custom sampler and you have defined a field in it
>  and
>  >  you
>  >  > want to pass in a variable?
>  >  >
>  >  > regards
>  >  > deepak
>  >  >
>  >  > On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>  >  >
>  >  > > I think it is something in the GUI Config class.
>  >  > >
>  >  > > Is there a template anywhere that I can base my GUI code off?
>  >  > > Regards
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > > __________________________________________________________
>  >  > >
>  >  > >
>  >  > >
>  >  > >             Deepak Shetty
>  >  > >             <shettyd@gmail.com
>  >  > >             >
>  >  To
>  >  > >                                        JMeter Users List
>  >  > >             Apr 13 2010 16:55
>  <jm...@jakarta.apache.org>
>  >  > >
>  >  cc
>  >  > >             Mail Size: 7046
>  >  > >
>  >  Subject
>  >  > >                                        Re: User defined variables
>  >  > >
>  >  > >             Please respond to
>  >  > >               "JMeter Users
>  >  > >                   List"
>  >  > >             <jmeter-user@jakar
>  >  > >               ta.apache.org>
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > >
>  >  > > should have worked . There might be a case mismatch or whitespace or
>  >  > > something in the UDV. if you have verified that then what is your
>  exact
>  >  > > Test
>  >  > > Structure and definition?(also did you get any errors in jmeter.log)
>  >  > >
>  >  > > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>  >  > >
>  >  > > >
>  >  > > > All
>  >  > > >
>  >  > > > Could how do I get my sampler to access user defined variables.
>  When
>  >  I
>  >  > > set
>  >  > > > a UDV Config element inside my ThreadGroup and put ${SERVER} in
>  one
>  >  of
>  >  > > the
>  >  > > > text fields in my SamplerGUI
>  >  > > > the sample gui just puts ${SERVER} in the Sampler variable. Am I
>  >  > missing
>  >  > > > something. Is there an example Sampler one could use.
>  >  > > >
>  >  > > >
>  >  > > >
>  >  > > >
>  >  > > > -----------------------------------------
>  >  > > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >  > > >
>  >  > > > This transmission has been issued by a member of the HSBC Group
>  >  > > > "HSBC" for the information of the addressee only and should not be
>  >  > > > reproduced and/or distributed to any other person. Each page
>  >  > > > attached hereto must be read in conjunction with any disclaimer
>  >  > > > which forms part of it. Unless otherwise stated, this transmission
>  >  > > > is neither an offer nor the solicitation of an offer to sell or
>  >  > > > purchase any investment. Its contents are based on information
>  >  > > > obtained from sources believed to be reliable but HSBC makes no
>  >  > > > representation and accepts no responsibility or liability as to
>  its
>  >  > > > completeness or accuracy.
>  >  > > >
>  >  > > >
>  ---------------------------------------------------------------------
>  >  > > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  > > > For additional commands, e-mail:
>  jmeter-user-help@jakarta.apache.org
>  >  > > >
>  >  > > >
>  >  > >
>  >  > >
>  >  > > -----------------------------------------
>  >  > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >  > >
>  >  > > This transmission has been issued by a member of the HSBC Group
>  >  > > "HSBC" for the information of the addressee only and should not be
>  >  > > reproduced and/or distributed to any other person. Each page
>  >  > > attached hereto must be read in conjunction with any disclaimer
>  >  > > which forms part of it. Unless otherwise stated, this transmission
>  >  > > is neither an offer nor the solicitation of an offer to sell or
>  >  > > purchase any investment. Its contents are based on information
>  >  > > obtained from sources believed to be reliable but HSBC makes no
>  >  > > representation and accepts no responsibility or liability as to its
>  >  > > completeness or accuracy.
>  >  > >
>  >  > >
>  ---------------------------------------------------------------------
>  >  > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >  > >
>  >  > >
>  >  >
>  >  >
>  >  > -----------------------------------------
>  >  > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >  >
>  >  > This transmission has been issued by a member of the HSBC Group
>  >  > "HSBC" for the information of the addressee only and should not be
>  >  > reproduced and/or distributed to any other person. Each page
>  >  > attached hereto must be read in conjunction with any disclaimer
>  >  > which forms part of it. Unless otherwise stated, this transmission
>  >  > is neither an offer nor the solicitation of an offer to sell or
>  >  > purchase any investment. Its contents are based on information
>  >  > obtained from sources believed to be reliable but HSBC makes no
>  >  > representation and accepts no responsibility or liability as to its
>  >  > completeness or accuracy.
>  >  >
>  >  > ---------------------------------------------------------------------
>  >  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >  >
>  >  >
>  >
>  >
>  >
>  >
>  > ************************************************************
>  >  HSBC Bank plc may be solicited in the course of its placement efforts
>  for a
>  >  new issue, by investment clients of the firm for whom the Bank as a firm
>  >  already provides other services. It may equally decide to allocate to
>  its
>  >  own proprietary book or with an associate of HSBC Group. This represents
>  a
>  >  potential conflict of interest. HSBC Bank plc has internal arrangements
>  >  designed to ensure that the firm would give unbiased and full advice to
>  the
>  >  corporate finance client about the valuation and pricing of the offering
>  as
>  >  well as internal systems, controls and procedures to identify and manage
>  >  conflicts of interest.
>  >
>  >  HSBC Bank plc
>  >  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  >  Registered in England - Number 14259
>  >  Authorised and regulated by the Financial Services Authority.
>  >  ************************************************************
>  >
>  >
>  >  -----------------------------------------
>  >  SAVE PAPER - THINK BEFORE YOU PRINT!
>  >
>  >  This transmission has been issued by a member of the HSBC Group
>  >  "HSBC" for the information of the addressee only and should not be
>  >  reproduced and/or distributed to any other person. Each page
>  >  attached hereto must be read in conjunction with any disclaimer
>  >  which forms part of it. Unless otherwise stated, this transmission
>  >  is neither an offer nor the solicitation of an offer to sell or
>  >  purchase any investment. Its contents are based on information
>  >  obtained from sources believed to be reliable but HSBC makes no
>  >  representation and accepts no responsibility or liability as to its
>  >  completeness or accuracy.
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
>
>  ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to its
>  own proprietary book or with an associate of HSBC Group. This represents a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to the
>  corporate finance client about the valuation and pricing of the offering as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>
>  ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to its
>  own proprietary book or with an associate of HSBC Group. This represents a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to the
>  corporate finance client about the valuation and pricing of the offering as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>  -----------------------------------------
>  SAVE PAPER - THINK BEFORE YOU PRINT!
>
>  This transmission has been issued by a member of the HSBC Group
>  "HSBC" for the information of the addressee only and should not be
>  reproduced and/or distributed to any other person. Each page
>  attached hereto must be read in conjunction with any disclaimer
>  which forms part of it. Unless otherwise stated, this transmission
>  is neither an offer nor the solicitation of an offer to sell or
>  purchase any investment. Its contents are based on information
>  obtained from sources believed to be reliable but HSBC makes no
>  representation and accepts no responsibility or liability as to its
>  completeness or accuracy.
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by be...@hsbcib.com.
Sebb

I have a question. I want to set my own sample time. I am sending out a
message to a remote system and waiting for the Ack to come back. In a
session class
i set the System.nanoTime() on the way out and then when we receive the
incoming response. How can I set this on the sample? as the setTime is
deprecated.





__________________________________________________________


                                                                           
             Ben                                                           
             CUTHBERT/IBEU/HSB                                             
             C                                                          To 
                                       "JMeter Users List"                 
             Apr 14 2010 10:37         <jm...@jakarta.apache.org>    
                                                                        cc 
             Phone no. 22200           JMeter Users List                   
             44 0 44 20 799            <jm...@jakarta.apache.org>    
             22192                                                 Subject 
             Mail Size: 20586          Re: User defined variables(Document 
                                       link: Ben CUTHBERT)                 
                                                                           
                                                                           
                                                                    Entity 
                                                                           
                                                                           
                                                                           



Hi Sorry about the attachments. Sorry what is the debug sampler?


Regards



                                                                           
             sebb                                                          
             <se...@gmail.com>                                            
                                                                        To 
             Apr 14 2010 10:33          JMeter Users List                  
                                        <jm...@jakarta.apache.org>   
             Mail Size: 19074                                           cc 
                                                                           
                                                                   Subject 
                                        Re: User defined variables         
             Please respond to                                             
               "JMeter Users                                               
                   List"                                            Entity 
             <jmeter-user@jakar                                            
               ta.apache.org>                                              
                                                                           
                                                                           




On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
> Hi Sebb
>
>  I have attached screenshots of my test plan. When the test starts the
>  following logging statement has been placed in the sampler. But the host
>  values does not get populated
>  with what is defined in the UDV.

Did you try using a Debug Sampler?

Please don't send attachments to the list - they are too heavy and
tend to fall off ;-)

Upload them somewhere public and post the URL instead.

>  010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Running
the
>  test!
>  2010/04/14 09:54:02 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning
>  (true,*local*)
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Starting
1
>  threads for group Thread Group. Ramp up = 50.
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Test
will
>  stop on error
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: All
threads
>  have been started
>  2010/04/14 09:54:02 INFO  - jmeter.threads.JMeterThread: Thread started:
>  Thread Group 1-1
>  2010/04/14 09:54:03 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  2010/04/14 09:54:04 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  2010/04/14 09:54:05 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>
>
>  (Embedded image moved to file: pic19853.gif)
>
>
>  (Embedded image moved to file: pic29034.gif)
>
>
>
>
>  Regards
>
>
>
>
>
>  __________________________________________________________
>
>
>
>              Deepak Shetty
>              <shettyd@gmail.com
>              >
To
>                                         JMeter Users List
>
>              Apr 13 2010 18:07          <jm...@jakarta.apache.org>
>
cc
>              Mail Size: 13872
>
>
Subject
>                                         Re: User defined variables
>
>              Please respond to
>
>                "JMeter Users
Entity
>
>                    List"
>              <jmeter-user@jakar
>                ta.apache.org>
>
>
>
>
>
>
>  Hi
>  I dont know much about the samplers so youll probably have to wait for
sebb
>  to reply.
>  However User defined variables apply at runtime. Whereas you seem to be
>  asking about load and store from the JMX file (in which case ${SERVER}
is
>  correct , the value will get replaced at runtime
>  regards
>  deepak
>
>  On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:
>
>  > Yes sorry.
>  >
>  > So I have a sample that looks like
>  >
>  > public class TestSampler extends AbstractSampler implements
TestListener
>  {
>  >
>  >  public final static String HOST = "TestSampler.remoteHost";
>  >
>  >
>  >   public final void setHost(String newServer) {
>  >            this.setProperty(HOST, newServer);
>  >   }
>  >
>  >   public final String getHost() {
>  >            return getPropertyAsString(HOST);
>  >   }
>  > }
>  >
>  > Now I would like to set this values based on a user defined variable
>  config
>  > above this sampler.
>  > So in my GUI config class for this sampler I have
>  >
>  >
>  > public class TestSamplerGui extends AbstractSamplerGui implements
>  > ActionListener, ChangeListener {
>  >
>  >   private final JLabeledTextField remoteHost = new JLabeledTextField(
>  > "Remote host"); //$NON-NLS-1$
>  >
>  >        @Override
>  >   protected void configureTestElement(TestElement mc) {
>  >           remoteHost.setText(mc.getPropertyAsString
(TestSampler.HOST));
>  >        }
>  >
>  >
>  >    public TestElement createTestElement() {
>  >        TestSampler  sampler = new TestSampler ();
>  >        modifyTestElement(sampler);
>  >
>  >        return sampler;
>  >    }
>  >
>  >
>  >        public void modifyTestElement(TestElement s) {
>  >      TestSamplerGui sampler = (TestSamplerGui ) s;
>  >      this.configureTestElement(sampler);
>  >      sampler.setProperty
(FIXProtocolMessageSampler.HOST,this.remoteHost
>  > .getText());
>  >         }
>  > }
>  >
>  > So the first time if you set the value for remote host on the front
end
>  > within the sampler gui it writes it to the .xml file. But when you
load
>  it
>  > again
>  > and try and update the host it just pulls the old value back because
of
>  the
>  > configureTestElement() method.
>  >
>  > This was copied from the FTPSampler on trunk
>  >
>  >
>  > Regards
>  >
>  >
>  > Ben CUTHBERT
>  >
>  >
>  > Futures and Options
>  > 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>  >
>  >
>  > __________________________________________________________
>  >
>  >
>  > Phone.     +44 (0) 20 799 22192
>  >
>  >
>  > Email.       ben.cuthbert@hsbcib.com
>  >
>  >
>  > __________________________________________________________
>  >
>  >
>  >
>  >             Deepak Shetty
>  >             <shettyd@gmail.com
>  >             >
To
>  >                                        JMeter Users List
>  >              Apr 13 2010 17:11
<jm...@jakarta.apache.org>
>  >
cc
>  >             Mail Size: 9388
>  >
>  Subject
>  >                                        Re: User defined variables
>  >
>  >             Please respond to
>  >               "JMeter Users
>  >                   List"
>  >             <jmeter-user@jakar
>  >               ta.apache.org>
>  >
>  >
>  >
>  >
>  >
>  >
>  > Sorry I think i misunderstood your question.
>  > You are writing a custom sampler and you have defined a field in it
and
>  you
>  > want to pass in a variable?
>  >
>  > regards
>  > deepak
>  >
>  > On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>  >
>  > > I think it is something in the GUI Config class.
>  > >
>  > > Is there a template anywhere that I can base my GUI code off?
>  > > Regards
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > __________________________________________________________
>  > >
>  > >
>  > >
>  > >             Deepak Shetty
>  > >             <shettyd@gmail.com
>  > >             >
>  To
>  > >                                        JMeter Users List
>  > >             Apr 13 2010 16:55
<jm...@jakarta.apache.org>
>  > >
>  cc
>  > >             Mail Size: 7046
>  > >
>  Subject
>  > >                                        Re: User defined variables
>  > >
>  > >             Please respond to
>  > >               "JMeter Users
>  > >                   List"
>  > >             <jmeter-user@jakar
>  > >               ta.apache.org>
>  > >
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > should have worked . There might be a case mismatch or whitespace or
>  > > something in the UDV. if you have verified that then what is your
exact
>  > > Test
>  > > Structure and definition?(also did you get any errors in jmeter.log)
>  > >
>  > > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>  > >
>  > > >
>  > > > All
>  > > >
>  > > > Could how do I get my sampler to access user defined variables.
When
>  I
>  > > set
>  > > > a UDV Config element inside my ThreadGroup and put ${SERVER} in
one
>  of
>  > > the
>  > > > text fields in my SamplerGUI
>  > > > the sample gui just puts ${SERVER} in the Sampler variable. Am I
>  > missing
>  > > > something. Is there an example Sampler one could use.
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > -----------------------------------------
>  > > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  > > >
>  > > > This transmission has been issued by a member of the HSBC Group
>  > > > "HSBC" for the information of the addressee only and should not be
>  > > > reproduced and/or distributed to any other person. Each page
>  > > > attached hereto must be read in conjunction with any disclaimer
>  > > > which forms part of it. Unless otherwise stated, this transmission
>  > > > is neither an offer nor the solicitation of an offer to sell or
>  > > > purchase any investment. Its contents are based on information
>  > > > obtained from sources believed to be reliable but HSBC makes no
>  > > > representation and accepts no responsibility or liability as to
its
>  > > > completeness or accuracy.
>  > > >
>  > > >
---------------------------------------------------------------------
>  > > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > > > For additional commands, e-mail:
jmeter-user-help@jakarta.apache.org
>  > > >
>  > > >
>  > >
>  > >
>  > > -----------------------------------------
>  > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  > >
>  > > This transmission has been issued by a member of the HSBC Group
>  > > "HSBC" for the information of the addressee only and should not be
>  > > reproduced and/or distributed to any other person. Each page
>  > > attached hereto must be read in conjunction with any disclaimer
>  > > which forms part of it. Unless otherwise stated, this transmission
>  > > is neither an offer nor the solicitation of an offer to sell or
>  > > purchase any investment. Its contents are based on information
>  > > obtained from sources believed to be reliable but HSBC makes no
>  > > representation and accepts no responsibility or liability as to its
>  > > completeness or accuracy.
>  > >
>  > >
---------------------------------------------------------------------
>  > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  > >
>  > >
>  >
>  >
>  > -----------------------------------------
>  > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >
>  > This transmission has been issued by a member of the HSBC Group
>  > "HSBC" for the information of the addressee only and should not be
>  > reproduced and/or distributed to any other person. Each page
>  > attached hereto must be read in conjunction with any disclaimer
>  > which forms part of it. Unless otherwise stated, this transmission
>  > is neither an offer nor the solicitation of an offer to sell or
>  > purchase any investment. Its contents are based on information
>  > obtained from sources believed to be reliable but HSBC makes no
>  > representation and accepts no responsibility or liability as to its
>  > completeness or accuracy.
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>  >
>
>
>
>
> ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts
for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to
its
>  own proprietary book or with an associate of HSBC Group. This represents
a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to
the
>  corporate finance client about the valuation and pricing of the offering
as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>
>  -----------------------------------------
>  SAVE PAPER - THINK BEFORE YOU PRINT!
>
>  This transmission has been issued by a member of the HSBC Group
>  "HSBC" for the information of the addressee only and should not be
>  reproduced and/or distributed to any other person. Each page
>  attached hereto must be read in conjunction with any disclaimer
>  which forms part of it. Unless otherwise stated, this transmission
>  is neither an offer nor the solicitation of an offer to sell or
>  purchase any investment. Its contents are based on information
>  obtained from sources believed to be reliable but HSBC makes no
>  representation and accepts no responsibility or liability as to its
>  completeness or accuracy.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org




************************************************************
HSBC Bank plc may be solicited in the course of its placement efforts for a
new issue, by investment clients of the firm for whom the Bank as a firm
already provides other services. It may equally decide to allocate to its
own proprietary book or with an associate of HSBC Group. This represents a
potential conflict of interest. HSBC Bank plc has internal arrangements
designed to ensure that the firm would give unbiased and full advice to the
corporate finance client about the valuation and pricing of the offering as
well as internal systems, controls and procedures to identify and manage
conflicts of interest.

HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
Registered in England - Number 14259
Authorised and regulated by the Financial Services Authority.
************************************************************


************************************************************
HSBC Bank plc may be solicited in the course of its placement efforts for a
new issue, by investment clients of the firm for whom the Bank as a firm
already provides other services. It may equally decide to allocate to its
own proprietary book or with an associate of HSBC Group. This represents a
potential conflict of interest. HSBC Bank plc has internal arrangements
designed to ensure that the firm would give unbiased and full advice to the
corporate finance client about the valuation and pricing of the offering as
well as internal systems, controls and procedures to identify and manage
conflicts of interest.

HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
Registered in England - Number 14259
Authorised and regulated by the Financial Services Authority.
************************************************************

-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by sebb <se...@gmail.com>.
On 14/04/2010, ben.cuthbert@hsbcib.com <be...@hsbcib.com> wrote:
> Hi Sebb
>
>  I have attached screenshots of my test plan. When the test starts the
>  following logging statement has been placed in the sampler. But the host
>  values does not get populated
>  with what is defined in the UDV.

Did you try using a Debug Sampler?

Please don't send attachments to the list - they are too heavy and
tend to fall off ;-)

Upload them somewhere public and post the URL instead.

>  010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Running the
>  test!
>  2010/04/14 09:54:02 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning
>  (true,*local*)
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Starting 1
>  threads for group Thread Group. Ramp up = 50.
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Test will
>  stop on error
>  2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: All threads
>  have been started
>  2010/04/14 09:54:02 INFO  - jmeter.threads.JMeterThread: Thread started:
>  Thread Group 1-1
>  2010/04/14 09:54:03 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  2010/04/14 09:54:04 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>  2010/04/14 09:54:05 INFO  -
>  com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
>  (Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
>
>
>  (Embedded image moved to file: pic19853.gif)
>
>
>  (Embedded image moved to file: pic29034.gif)
>
>
>
>
>  Regards
>
>
>
>
>
>  __________________________________________________________
>
>
>
>              Deepak Shetty
>              <shettyd@gmail.com
>              >                                                          To
>                                         JMeter Users List
>
>              Apr 13 2010 18:07          <jm...@jakarta.apache.org>
>                                                                         cc
>              Mail Size: 13872
>
>                                                                    Subject
>                                         Re: User defined variables
>
>              Please respond to
>
>                "JMeter Users                                        Entity
>
>                    List"
>              <jmeter-user@jakar
>                ta.apache.org>
>
>
>
>
>
>
>  Hi
>  I dont know much about the samplers so youll probably have to wait for sebb
>  to reply.
>  However User defined variables apply at runtime. Whereas you seem to be
>  asking about load and store from the JMX file (in which case ${SERVER} is
>  correct , the value will get replaced at runtime
>  regards
>  deepak
>
>  On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:
>
>  > Yes sorry.
>  >
>  > So I have a sample that looks like
>  >
>  > public class TestSampler extends AbstractSampler implements TestListener
>  {
>  >
>  >  public final static String HOST = "TestSampler.remoteHost";
>  >
>  >
>  >   public final void setHost(String newServer) {
>  >            this.setProperty(HOST, newServer);
>  >   }
>  >
>  >   public final String getHost() {
>  >            return getPropertyAsString(HOST);
>  >   }
>  > }
>  >
>  > Now I would like to set this values based on a user defined variable
>  config
>  > above this sampler.
>  > So in my GUI config class for this sampler I have
>  >
>  >
>  > public class TestSamplerGui extends AbstractSamplerGui implements
>  > ActionListener, ChangeListener {
>  >
>  >   private final JLabeledTextField remoteHost = new JLabeledTextField(
>  > "Remote host"); //$NON-NLS-1$
>  >
>  >        @Override
>  >   protected void configureTestElement(TestElement mc) {
>  >           remoteHost.setText(mc.getPropertyAsString(TestSampler.HOST));
>  >        }
>  >
>  >
>  >    public TestElement createTestElement() {
>  >        TestSampler  sampler = new TestSampler ();
>  >        modifyTestElement(sampler);
>  >
>  >        return sampler;
>  >    }
>  >
>  >
>  >        public void modifyTestElement(TestElement s) {
>  >      TestSamplerGui sampler = (TestSamplerGui ) s;
>  >      this.configureTestElement(sampler);
>  >      sampler.setProperty(FIXProtocolMessageSampler.HOST,this.remoteHost
>  > .getText());
>  >         }
>  > }
>  >
>  > So the first time if you set the value for remote host on the front end
>  > within the sampler gui it writes it to the .xml file. But when you load
>  it
>  > again
>  > and try and update the host it just pulls the old value back because of
>  the
>  > configureTestElement() method.
>  >
>  > This was copied from the FTPSampler on trunk
>  >
>  >
>  > Regards
>  >
>  >
>  > Ben CUTHBERT
>  >
>  >
>  > Futures and Options
>  > 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>  >
>  >
>  > __________________________________________________________
>  >
>  >
>  > Phone.     +44 (0) 20 799 22192
>  >
>  >
>  > Email.       ben.cuthbert@hsbcib.com
>  >
>  >
>  > __________________________________________________________
>  >
>  >
>  >
>  >             Deepak Shetty
>  >             <shettyd@gmail.com
>  >             >                                                          To
>  >                                        JMeter Users List
>  >              Apr 13 2010 17:11          <jm...@jakarta.apache.org>
>  >                                                                        cc
>  >             Mail Size: 9388
>  >
>  Subject
>  >                                        Re: User defined variables
>  >
>  >             Please respond to
>  >               "JMeter Users
>  >                   List"
>  >             <jmeter-user@jakar
>  >               ta.apache.org>
>  >
>  >
>  >
>  >
>  >
>  >
>  > Sorry I think i misunderstood your question.
>  > You are writing a custom sampler and you have defined a field in it and
>  you
>  > want to pass in a variable?
>  >
>  > regards
>  > deepak
>  >
>  > On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>  >
>  > > I think it is something in the GUI Config class.
>  > >
>  > > Is there a template anywhere that I can base my GUI code off?
>  > > Regards
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > __________________________________________________________
>  > >
>  > >
>  > >
>  > >             Deepak Shetty
>  > >             <shettyd@gmail.com
>  > >             >
>  To
>  > >                                        JMeter Users List
>  > >             Apr 13 2010 16:55          <jm...@jakarta.apache.org>
>  > >
>  cc
>  > >             Mail Size: 7046
>  > >
>  Subject
>  > >                                        Re: User defined variables
>  > >
>  > >             Please respond to
>  > >               "JMeter Users
>  > >                   List"
>  > >             <jmeter-user@jakar
>  > >               ta.apache.org>
>  > >
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > should have worked . There might be a case mismatch or whitespace or
>  > > something in the UDV. if you have verified that then what is your exact
>  > > Test
>  > > Structure and definition?(also did you get any errors in jmeter.log)
>  > >
>  > > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>  > >
>  > > >
>  > > > All
>  > > >
>  > > > Could how do I get my sampler to access user defined variables. When
>  I
>  > > set
>  > > > a UDV Config element inside my ThreadGroup and put ${SERVER} in one
>  of
>  > > the
>  > > > text fields in my SamplerGUI
>  > > > the sample gui just puts ${SERVER} in the Sampler variable. Am I
>  > missing
>  > > > something. Is there an example Sampler one could use.
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > -----------------------------------------
>  > > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  > > >
>  > > > This transmission has been issued by a member of the HSBC Group
>  > > > "HSBC" for the information of the addressee only and should not be
>  > > > reproduced and/or distributed to any other person. Each page
>  > > > attached hereto must be read in conjunction with any disclaimer
>  > > > which forms part of it. Unless otherwise stated, this transmission
>  > > > is neither an offer nor the solicitation of an offer to sell or
>  > > > purchase any investment. Its contents are based on information
>  > > > obtained from sources believed to be reliable but HSBC makes no
>  > > > representation and accepts no responsibility or liability as to its
>  > > > completeness or accuracy.
>  > > >
>  > > > ---------------------------------------------------------------------
>  > > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  > > >
>  > > >
>  > >
>  > >
>  > > -----------------------------------------
>  > > SAVE PAPER - THINK BEFORE YOU PRINT!
>  > >
>  > > This transmission has been issued by a member of the HSBC Group
>  > > "HSBC" for the information of the addressee only and should not be
>  > > reproduced and/or distributed to any other person. Each page
>  > > attached hereto must be read in conjunction with any disclaimer
>  > > which forms part of it. Unless otherwise stated, this transmission
>  > > is neither an offer nor the solicitation of an offer to sell or
>  > > purchase any investment. Its contents are based on information
>  > > obtained from sources believed to be reliable but HSBC makes no
>  > > representation and accepts no responsibility or liability as to its
>  > > completeness or accuracy.
>  > >
>  > > ---------------------------------------------------------------------
>  > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  > >
>  > >
>  >
>  >
>  > -----------------------------------------
>  > SAVE PAPER - THINK BEFORE YOU PRINT!
>  >
>  > This transmission has been issued by a member of the HSBC Group
>  > "HSBC" for the information of the addressee only and should not be
>  > reproduced and/or distributed to any other person. Each page
>  > attached hereto must be read in conjunction with any disclaimer
>  > which forms part of it. Unless otherwise stated, this transmission
>  > is neither an offer nor the solicitation of an offer to sell or
>  > purchase any investment. Its contents are based on information
>  > obtained from sources believed to be reliable but HSBC makes no
>  > representation and accepts no responsibility or liability as to its
>  > completeness or accuracy.
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>  >
>
>
>
>
> ************************************************************
>  HSBC Bank plc may be solicited in the course of its placement efforts for a
>  new issue, by investment clients of the firm for whom the Bank as a firm
>  already provides other services. It may equally decide to allocate to its
>  own proprietary book or with an associate of HSBC Group. This represents a
>  potential conflict of interest. HSBC Bank plc has internal arrangements
>  designed to ensure that the firm would give unbiased and full advice to the
>  corporate finance client about the valuation and pricing of the offering as
>  well as internal systems, controls and procedures to identify and manage
>  conflicts of interest.
>
>  HSBC Bank plc
>  Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
>  Registered in England - Number 14259
>  Authorised and regulated by the Financial Services Authority.
>  ************************************************************
>
>
>  -----------------------------------------
>  SAVE PAPER - THINK BEFORE YOU PRINT!
>
>  This transmission has been issued by a member of the HSBC Group
>  "HSBC" for the information of the addressee only and should not be
>  reproduced and/or distributed to any other person. Each page
>  attached hereto must be read in conjunction with any disclaimer
>  which forms part of it. Unless otherwise stated, this transmission
>  is neither an offer nor the solicitation of an offer to sell or
>  purchase any investment. Its contents are based on information
>  obtained from sources believed to be reliable but HSBC makes no
>  representation and accepts no responsibility or liability as to its
>  completeness or accuracy.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by be...@hsbcib.com.
Hi Sebb

I have attached screenshots of my test plan. When the test starts the
following logging statement has been placed in the sampler. But the host
values does not get populated
with what is defined in the UDV.

010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Running the
test!
2010/04/14 09:54:02 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning
(true,*local*)
2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Starting 1
threads for group Thread Group. Ramp up = 50.
2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: Test will
stop on error
2010/04/14 09:54:02 INFO  - jmeter.engine.StandardJMeterEngine: All threads
have been started
2010/04/14 09:54:02 INFO  - jmeter.threads.JMeterThread: Thread started:
Thread Group 1-1
2010/04/14 09:54:03 INFO  -
com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
(Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
2010/04/14 09:54:04 INFO  -
com.hsbc.jmeter.protocol.test.samplerTestSampler Starting sampler
(Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)
2010/04/14 09:54:05 INFO  -
com.hsbc.jmeter.protocol.test.samplerTestSampler: Starting sampler
(Host:FIXMessageSampler.remoteHost,Port:FIXMessageSampler.remotePort)


(Embedded image moved to file: pic19853.gif)


(Embedded image moved to file: pic29034.gif)



Regards





__________________________________________________________


                                                                           
             Deepak Shetty                                                 
             <shettyd@gmail.com                                            
             >                                                          To 
                                        JMeter Users List                  
             Apr 13 2010 18:07          <jm...@jakarta.apache.org>   
                                                                        cc 
             Mail Size: 13872                                              
                                                                   Subject 
                                        Re: User defined variables         
                                                                           
             Please respond to                                             
               "JMeter Users                                        Entity 
                   List"                                                   
             <jmeter-user@jakar                                            
               ta.apache.org>                                              
                                                                           
                                                                           




Hi
I dont know much about the samplers so youll probably have to wait for sebb
to reply.
However User defined variables apply at runtime. Whereas you seem to be
asking about load and store from the JMX file (in which case ${SERVER} is
correct , the value will get replaced at runtime
regards
deepak

On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:

> Yes sorry.
>
> So I have a sample that looks like
>
> public class TestSampler extends AbstractSampler implements TestListener
{
>
>  public final static String HOST = "TestSampler.remoteHost";
>
>
>   public final void setHost(String newServer) {
>            this.setProperty(HOST, newServer);
>   }
>
>   public final String getHost() {
>            return getPropertyAsString(HOST);
>   }
> }
>
> Now I would like to set this values based on a user defined variable
config
> above this sampler.
> So in my GUI config class for this sampler I have
>
>
> public class TestSamplerGui extends AbstractSamplerGui implements
> ActionListener, ChangeListener {
>
>   private final JLabeledTextField remoteHost = new JLabeledTextField(
> "Remote host"); //$NON-NLS-1$
>
>        @Override
>   protected void configureTestElement(TestElement mc) {
>           remoteHost.setText(mc.getPropertyAsString(TestSampler.HOST));
>        }
>
>
>    public TestElement createTestElement() {
>        TestSampler  sampler = new TestSampler ();
>        modifyTestElement(sampler);
>
>        return sampler;
>    }
>
>
>        public void modifyTestElement(TestElement s) {
>      TestSamplerGui sampler = (TestSamplerGui ) s;
>      this.configureTestElement(sampler);
>      sampler.setProperty(FIXProtocolMessageSampler.HOST,this.remoteHost
> .getText());
>         }
> }
>
> So the first time if you set the value for remote host on the front end
> within the sampler gui it writes it to the .xml file. But when you load
it
> again
> and try and update the host it just pulls the old value back because of
the
> configureTestElement() method.
>
> This was copied from the FTPSampler on trunk
>
>
> Regards
>
>
> Ben CUTHBERT
>
>
> Futures and Options
> 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>
>
> __________________________________________________________
>
>
> Phone.     +44 (0) 20 799 22192
>
>
> Email.       ben.cuthbert@hsbcib.com
>
>
> __________________________________________________________
>
>
>
>             Deepak Shetty
>             <shettyd@gmail.com
>             >                                                          To
>                                        JMeter Users List
>              Apr 13 2010 17:11          <jm...@jakarta.apache.org>
>                                                                        cc
>             Mail Size: 9388
>
Subject
>                                        Re: User defined variables
>
>             Please respond to
>               "JMeter Users
>                   List"
>             <jmeter-user@jakar
>               ta.apache.org>
>
>
>
>
>
>
> Sorry I think i misunderstood your question.
> You are writing a custom sampler and you have defined a field in it and
you
> want to pass in a variable?
>
> regards
> deepak
>
> On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>
> > I think it is something in the GUI Config class.
> >
> > Is there a template anywhere that I can base my GUI code off?
> > Regards
> >
> >
> >
> >
> >
> > __________________________________________________________
> >
> >
> >
> >             Deepak Shetty
> >             <shettyd@gmail.com
> >             >
To
> >                                        JMeter Users List
> >             Apr 13 2010 16:55          <jm...@jakarta.apache.org>
> >
cc
> >             Mail Size: 7046
> >
Subject
> >                                        Re: User defined variables
> >
> >             Please respond to
> >               "JMeter Users
> >                   List"
> >             <jmeter-user@jakar
> >               ta.apache.org>
> >
> >
> >
> >
> >
> >
> > should have worked . There might be a case mismatch or whitespace or
> > something in the UDV. if you have verified that then what is your exact
> > Test
> > Structure and definition?(also did you get any errors in jmeter.log)
> >
> > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
> >
> > >
> > > All
> > >
> > > Could how do I get my sampler to access user defined variables. When
I
> > set
> > > a UDV Config element inside my ThreadGroup and put ${SERVER} in one
of
> > the
> > > text fields in my SamplerGUI
> > > the sample gui just puts ${SERVER} in the Sampler variable. Am I
> missing
> > > something. Is there an example Sampler one could use.
> > >
> > >
> > >
> > >
> > > -----------------------------------------
> > > SAVE PAPER - THINK BEFORE YOU PRINT!
> > >
> > > This transmission has been issued by a member of the HSBC Group
> > > "HSBC" for the information of the addressee only and should not be
> > > reproduced and/or distributed to any other person. Each page
> > > attached hereto must be read in conjunction with any disclaimer
> > > which forms part of it. Unless otherwise stated, this transmission
> > > is neither an offer nor the solicitation of an offer to sell or
> > > purchase any investment. Its contents are based on information
> > > obtained from sources believed to be reliable but HSBC makes no
> > > representation and accepts no responsibility or liability as to its
> > > completeness or accuracy.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > -----------------------------------------
> > SAVE PAPER - THINK BEFORE YOU PRINT!
> >
> > This transmission has been issued by a member of the HSBC Group
> > "HSBC" for the information of the addressee only and should not be
> > reproduced and/or distributed to any other person. Each page
> > attached hereto must be read in conjunction with any disclaimer
> > which forms part of it. Unless otherwise stated, this transmission
> > is neither an offer nor the solicitation of an offer to sell or
> > purchase any investment. Its contents are based on information
> > obtained from sources believed to be reliable but HSBC makes no
> > representation and accepts no responsibility or liability as to its
> > completeness or accuracy.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



************************************************************
HSBC Bank plc may be solicited in the course of its placement efforts for a
new issue, by investment clients of the firm for whom the Bank as a firm
already provides other services. It may equally decide to allocate to its
own proprietary book or with an associate of HSBC Group. This represents a
potential conflict of interest. HSBC Bank plc has internal arrangements
designed to ensure that the firm would give unbiased and full advice to the
corporate finance client about the valuation and pricing of the offering as
well as internal systems, controls and procedures to identify and manage
conflicts of interest.

HSBC Bank plc
Registered Office: 8 Canada Square, London E14 5HQ, United Kingdom
Registered in England - Number 14259
Authorised and regulated by the Financial Services Authority.
************************************************************

-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

Re: User defined variables

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
I dont know much about the samplers so youll probably have to wait for sebb
to reply.
However User defined variables apply at runtime. Whereas you seem to be
asking about load and store from the JMX file (in which case ${SERVER} is
correct , the value will get replaced at runtime
regards
deepak

On Tue, Apr 13, 2010 at 9:17 AM, <be...@hsbcib.com> wrote:

> Yes sorry.
>
> So I have a sample that looks like
>
> public class TestSampler extends AbstractSampler implements TestListener {
>
>  public final static String HOST = "TestSampler.remoteHost";
>
>
>   public final void setHost(String newServer) {
>            this.setProperty(HOST, newServer);
>   }
>
>   public final String getHost() {
>            return getPropertyAsString(HOST);
>   }
> }
>
> Now I would like to set this values based on a user defined variable config
> above this sampler.
> So in my GUI config class for this sampler I have
>
>
> public class TestSamplerGui extends AbstractSamplerGui implements
> ActionListener, ChangeListener {
>
>   private final JLabeledTextField remoteHost = new JLabeledTextField(
> "Remote host"); //$NON-NLS-1$
>
>        @Override
>   protected void configureTestElement(TestElement mc) {
>           remoteHost.setText(mc.getPropertyAsString(TestSampler.HOST));
>        }
>
>
>    public TestElement createTestElement() {
>        TestSampler  sampler = new TestSampler ();
>        modifyTestElement(sampler);
>
>        return sampler;
>    }
>
>
>        public void modifyTestElement(TestElement s) {
>      TestSamplerGui sampler = (TestSamplerGui ) s;
>      this.configureTestElement(sampler);
>      sampler.setProperty(FIXProtocolMessageSampler.HOST,this.remoteHost
> .getText());
>         }
> }
>
> So the first time if you set the value for remote host on the front end
> within the sampler gui it writes it to the .xml file. But when you load it
> again
> and try and update the host it just pulls the old value back because of the
> configureTestElement() method.
>
> This was copied from the FTPSampler on trunk
>
>
> Regards
>
>
> Ben CUTHBERT
>
>
> Futures and Options
> 8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom
>
>
> __________________________________________________________
>
>
> Phone.     +44 (0) 20 799 22192
>
>
> Email.       ben.cuthbert@hsbcib.com
>
>
> __________________________________________________________
>
>
>
>             Deepak Shetty
>             <shettyd@gmail.com
>             >                                                          To
>                                        JMeter Users List
>              Apr 13 2010 17:11          <jm...@jakarta.apache.org>
>                                                                        cc
>             Mail Size: 9388
>                                                                    Subject
>                                        Re: User defined variables
>
>             Please respond to
>               "JMeter Users
>                   List"
>             <jmeter-user@jakar
>               ta.apache.org>
>
>
>
>
>
>
> Sorry I think i misunderstood your question.
> You are writing a custom sampler and you have defined a field in it and you
> want to pass in a variable?
>
> regards
> deepak
>
> On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:
>
> > I think it is something in the GUI Config class.
> >
> > Is there a template anywhere that I can base my GUI code off?
> > Regards
> >
> >
> >
> >
> >
> > __________________________________________________________
> >
> >
> >
> >             Deepak Shetty
> >             <shettyd@gmail.com
> >             >                                                          To
> >                                        JMeter Users List
> >             Apr 13 2010 16:55          <jm...@jakarta.apache.org>
> >                                                                        cc
> >             Mail Size: 7046
> >                                                                   Subject
> >                                        Re: User defined variables
> >
> >             Please respond to
> >               "JMeter Users
> >                   List"
> >             <jmeter-user@jakar
> >               ta.apache.org>
> >
> >
> >
> >
> >
> >
> > should have worked . There might be a case mismatch or whitespace or
> > something in the UDV. if you have verified that then what is your exact
> > Test
> > Structure and definition?(also did you get any errors in jmeter.log)
> >
> > On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
> >
> > >
> > > All
> > >
> > > Could how do I get my sampler to access user defined variables. When I
> > set
> > > a UDV Config element inside my ThreadGroup and put ${SERVER} in one of
> > the
> > > text fields in my SamplerGUI
> > > the sample gui just puts ${SERVER} in the Sampler variable. Am I
> missing
> > > something. Is there an example Sampler one could use.
> > >
> > >
> > >
> > >
> > > -----------------------------------------
> > > SAVE PAPER - THINK BEFORE YOU PRINT!
> > >
> > > This transmission has been issued by a member of the HSBC Group
> > > "HSBC" for the information of the addressee only and should not be
> > > reproduced and/or distributed to any other person. Each page
> > > attached hereto must be read in conjunction with any disclaimer
> > > which forms part of it. Unless otherwise stated, this transmission
> > > is neither an offer nor the solicitation of an offer to sell or
> > > purchase any investment. Its contents are based on information
> > > obtained from sources believed to be reliable but HSBC makes no
> > > representation and accepts no responsibility or liability as to its
> > > completeness or accuracy.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > -----------------------------------------
> > SAVE PAPER - THINK BEFORE YOU PRINT!
> >
> > This transmission has been issued by a member of the HSBC Group
> > "HSBC" for the information of the addressee only and should not be
> > reproduced and/or distributed to any other person. Each page
> > attached hereto must be read in conjunction with any disclaimer
> > which forms part of it. Unless otherwise stated, this transmission
> > is neither an offer nor the solicitation of an offer to sell or
> > purchase any investment. Its contents are based on information
> > obtained from sources believed to be reliable but HSBC makes no
> > representation and accepts no responsibility or liability as to its
> > completeness or accuracy.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: User defined variables

Posted by be...@hsbcib.com.
Yes sorry.

So I have a sample that looks like

public class TestSampler extends AbstractSampler implements TestListener {

  public final static String HOST = "TestSampler.remoteHost";


   public final void setHost(String newServer) {
            this.setProperty(HOST, newServer);
   }

   public final String getHost() {
            return getPropertyAsString(HOST);
   }
}

Now I would like to set this values based on a user defined variable config
above this sampler.
So in my GUI config class for this sampler I have


public class TestSamplerGui extends AbstractSamplerGui implements
ActionListener, ChangeListener {

   private final JLabeledTextField remoteHost = new JLabeledTextField(
"Remote host"); //$NON-NLS-1$

        @Override
   protected void configureTestElement(TestElement mc) {
           remoteHost.setText(mc.getPropertyAsString(TestSampler.HOST));
        }


    public TestElement createTestElement() {
        TestSampler  sampler = new TestSampler ();
        modifyTestElement(sampler);

        return sampler;
    }


        public void modifyTestElement(TestElement s) {
      TestSamplerGui sampler = (TestSamplerGui ) s;
      this.configureTestElement(sampler);
      sampler.setProperty(FIXProtocolMessageSampler.HOST,this.remoteHost
.getText());
         }
}

So the first time if you set the value for remote host on the front end
within the sampler gui it writes it to the .xml file. But when you load it
again
and try and update the host it just pulls the old value back because of the
configureTestElement() method.

This was copied from the FTPSampler on trunk


Regards


Ben CUTHBERT


Futures and Options
8 Canada Square,Canary Wharf,London,E14 5HQ,United Kingdom


__________________________________________________________


Phone.     +44 (0) 20 799 22192


Email.       ben.cuthbert@hsbcib.com


__________________________________________________________


                                                                           
             Deepak Shetty                                                 
             <shettyd@gmail.com                                            
             >                                                          To 
                                        JMeter Users List                  
             Apr 13 2010 17:11          <jm...@jakarta.apache.org>   
                                                                        cc 
             Mail Size: 9388                                               
                                                                   Subject 
                                        Re: User defined variables         
                                                                           
             Please respond to                                             
               "JMeter Users                                               
                   List"                                                   
             <jmeter-user@jakar                                            
               ta.apache.org>                                              
                                                                           
                                                                           




Sorry I think i misunderstood your question.
You are writing a custom sampler and you have defined a field in it and you
want to pass in a variable?

regards
deepak

On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:

> I think it is something in the GUI Config class.
>
> Is there a template anywhere that I can base my GUI code off?
> Regards
>
>
>
>
>
> __________________________________________________________
>
>
>
>             Deepak Shetty
>             <shettyd@gmail.com
>             >                                                          To
>                                        JMeter Users List
>             Apr 13 2010 16:55          <jm...@jakarta.apache.org>
>                                                                        cc
>             Mail Size: 7046
>                                                                   Subject
>                                        Re: User defined variables
>
>             Please respond to
>               "JMeter Users
>                   List"
>             <jmeter-user@jakar
>               ta.apache.org>
>
>
>
>
>
>
> should have worked . There might be a case mismatch or whitespace or
> something in the UDV. if you have verified that then what is your exact
> Test
> Structure and definition?(also did you get any errors in jmeter.log)
>
> On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>
> >
> > All
> >
> > Could how do I get my sampler to access user defined variables. When I
> set
> > a UDV Config element inside my ThreadGroup and put ${SERVER} in one of
> the
> > text fields in my SamplerGUI
> > the sample gui just puts ${SERVER} in the Sampler variable. Am I
missing
> > something. Is there an example Sampler one could use.
> >
> >
> >
> >
> > -----------------------------------------
> > SAVE PAPER - THINK BEFORE YOU PRINT!
> >
> > This transmission has been issued by a member of the HSBC Group
> > "HSBC" for the information of the addressee only and should not be
> > reproduced and/or distributed to any other person. Each page
> > attached hereto must be read in conjunction with any disclaimer
> > which forms part of it. Unless otherwise stated, this transmission
> > is neither an offer nor the solicitation of an offer to sell or
> > purchase any investment. Its contents are based on information
> > obtained from sources believed to be reliable but HSBC makes no
> > representation and accepts no responsibility or liability as to its
> > completeness or accuracy.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by Deepak Shetty <sh...@gmail.com>.
Sorry I think i misunderstood your question.
You are writing a custom sampler and you have defined a field in it and you
want to pass in a variable?

regards
deepak

On Tue, Apr 13, 2010 at 8:58 AM, <be...@hsbcib.com> wrote:

> I think it is something in the GUI Config class.
>
> Is there a template anywhere that I can base my GUI code off?
> Regards
>
>
>
>
>
> __________________________________________________________
>
>
>
>             Deepak Shetty
>             <shettyd@gmail.com
>             >                                                          To
>                                        JMeter Users List
>             Apr 13 2010 16:55          <jm...@jakarta.apache.org>
>                                                                        cc
>             Mail Size: 7046
>                                                                   Subject
>                                        Re: User defined variables
>
>             Please respond to
>               "JMeter Users
>                   List"
>             <jmeter-user@jakar
>               ta.apache.org>
>
>
>
>
>
>
> should have worked . There might be a case mismatch or whitespace or
> something in the UDV. if you have verified that then what is your exact
> Test
> Structure and definition?(also did you get any errors in jmeter.log)
>
> On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:
>
> >
> > All
> >
> > Could how do I get my sampler to access user defined variables. When I
> set
> > a UDV Config element inside my ThreadGroup and put ${SERVER} in one of
> the
> > text fields in my SamplerGUI
> > the sample gui just puts ${SERVER} in the Sampler variable. Am I missing
> > something. Is there an example Sampler one could use.
> >
> >
> >
> >
> > -----------------------------------------
> > SAVE PAPER - THINK BEFORE YOU PRINT!
> >
> > This transmission has been issued by a member of the HSBC Group
> > "HSBC" for the information of the addressee only and should not be
> > reproduced and/or distributed to any other person. Each page
> > attached hereto must be read in conjunction with any disclaimer
> > which forms part of it. Unless otherwise stated, this transmission
> > is neither an offer nor the solicitation of an offer to sell or
> > purchase any investment. Its contents are based on information
> > obtained from sources believed to be reliable but HSBC makes no
> > representation and accepts no responsibility or liability as to its
> > completeness or accuracy.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: User defined variables

Posted by be...@hsbcib.com.
I think it is something in the GUI Config class.

Is there a template anywhere that I can base my GUI code off?
Regards





__________________________________________________________


                                                                           
             Deepak Shetty                                                 
             <shettyd@gmail.com                                            
             >                                                          To 
                                        JMeter Users List                  
             Apr 13 2010 16:55          <jm...@jakarta.apache.org>   
                                                                        cc 
             Mail Size: 7046                                               
                                                                   Subject 
                                        Re: User defined variables         
                                                                           
             Please respond to                                             
               "JMeter Users                                               
                   List"                                                   
             <jmeter-user@jakar                                            
               ta.apache.org>                                              
                                                                           
                                                                           




should have worked . There might be a case mismatch or whitespace or
something in the UDV. if you have verified that then what is your exact
Test
Structure and definition?(also did you get any errors in jmeter.log)

On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:

>
> All
>
> Could how do I get my sampler to access user defined variables. When I
set
> a UDV Config element inside my ThreadGroup and put ${SERVER} in one of
the
> text fields in my SamplerGUI
> the sample gui just puts ${SERVER} in the Sampler variable. Am I missing
> something. Is there an example Sampler one could use.
>
>
>
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-----------------------------------------
SAVE PAPER - THINK BEFORE YOU PRINT!

This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the addressee only and should not be
reproduced and/or distributed to any other person. Each page
attached hereto must be read in conjunction with any disclaimer
which forms part of it. Unless otherwise stated, this transmission
is neither an offer nor the solicitation of an offer to sell or
purchase any investment. Its contents are based on information
obtained from sources believed to be reliable but HSBC makes no
representation and accepts no responsibility or liability as to its
completeness or accuracy.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: User defined variables

Posted by Deepak Shetty <sh...@gmail.com>.
should have worked . There might be a case mismatch or whitespace or
something in the UDV. if you have verified that then what is your exact Test
Structure and definition?(also did you get any errors in jmeter.log)

On Tue, Apr 13, 2010 at 2:49 AM, <be...@hsbcib.com> wrote:

>
> All
>
> Could how do I get my sampler to access user defined variables. When I set
> a UDV Config element inside my ThreadGroup and put ${SERVER} in one of the
> text fields in my SamplerGUI
> the sample gui just puts ${SERVER} in the Sampler variable. Am I missing
> something. Is there an example Sampler one could use.
>
>
>
>
> -----------------------------------------
> SAVE PAPER - THINK BEFORE YOU PRINT!
>
> This transmission has been issued by a member of the HSBC Group
> "HSBC" for the information of the addressee only and should not be
> reproduced and/or distributed to any other person. Each page
> attached hereto must be read in conjunction with any disclaimer
> which forms part of it. Unless otherwise stated, this transmission
> is neither an offer nor the solicitation of an offer to sell or
> purchase any investment. Its contents are based on information
> obtained from sources believed to be reliable but HSBC makes no
> representation and accepts no responsibility or liability as to its
> completeness or accuracy.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>