Quantcast

Defining a variable value of 'line feed' (ASCII character)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Defining a variable value of 'line feed' (ASCII character)

nam.truong
Hello,

I would like to assign the value of a line feed character (ASCII 10) to a user defined variable.

So far my attempt to paste the character into JMeter is only producing a whitespace character. The usual ALT-010 hotkey isn't working for me either (this produces nothing).

Does anyone have a clue how this character may be set as a value?

Cheers,
Nam
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Defining a variable value of 'line feed' (ASCII character)

sebb-2-2
On 14/07/2008, nam.truong <[hidden email]> wrote:

>
>  Hello,
>
>  I would like to assign the value of a line feed character (ASCII 10) to a
>  user defined variable.
>
>  So far my attempt to paste the character into JMeter is only producing a
>  whitespace character. The usual ALT-010 hotkey isn't working for me either
>  (this produces nothing).
>
>  Does anyone have a clue how this character may be set as a value?
>

I don't think this is possible using the GUI.

You may be able to do this by editting the JMX file - create a
variable and edit its value.

Otherwise, the only ways I can think of are:

Define a JMeter or system property as:

LF=\u000a

and use it as ${__P(LF)}

Use Beanshell or Jexl to define the variable: vars.put("LF","\n");
Use Regular Expression Post-Processor to extract a LineFeed from a response.
Maybe the property "line.separator" would be suitable: ${__P(line.separator)}

>  Cheers,
>  Nam
>
> --
>  View this message in context: http://www.nabble.com/Defining-a-variable-value-of-%27line-feed%27-%28ASCII-character%29-tp18439414p18439414.html
>  Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [hidden email]
>  For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Defining a variable value of 'line feed' (ASCII character)

nam.truong
That's done it!

Going by your first suggestion, I've edited the JMX and entered a line feed character directly as a value as follows:

<elementProp name="lf" elementType="Argument">
    <stringProp name="Argument.name">lf</stringProp>
    <stringProp name="Argument.value">
</stringProp>
    <stringProp name="Argument.metadata">=</stringProp>
</elementProp>

Works a treat.

It's worth noting that if I attempt to edit this value now from the GUI, it gets changed back to a whitespace character. But as long as I don't touch it then everything works fine.

Thanks for the help seb-2-2. Much appreciated.

Cheers,
Nam

sebb-2-2 wrote
On 14/07/2008, nam.truong <nam.truong@objectconsulting.com.au> wrote:
>
>  Hello,
>
>  I would like to assign the value of a line feed character (ASCII 10) to a
>  user defined variable.
>
>  So far my attempt to paste the character into JMeter is only producing a
>  whitespace character. The usual ALT-010 hotkey isn't working for me either
>  (this produces nothing).
>
>  Does anyone have a clue how this character may be set as a value?
>

I don't think this is possible using the GUI.

You may be able to do this by editting the JMX file - create a
variable and edit its value.

Otherwise, the only ways I can think of are:

Define a JMeter or system property as:

LF=\u000a

and use it as ${__P(LF)}

Use Beanshell or Jexl to define the variable: vars.put("LF","\n");
Use Regular Expression Post-Processor to extract a LineFeed from a response.
Maybe the property "line.separator" would be suitable: ${__P(line.separator)}

>  Cheers,
>  Nam
>
> --
>  View this message in context: http://www.nabble.com/Defining-a-variable-value-of-%27line-feed%27-%28ASCII-character%29-tp18439414p18439414.html
>  Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Defining a variable value of 'line feed' (ASCII character)

sebb-2-2
On 15/07/2008, nam.truong <[hidden email]> wrote:

>
>  That's done it!
>
>  Going by your first suggestion, I've edited the JMX and entered a line feed
>  character directly as a value as follows:
>
>  <elementProp name="lf" elementType="Argument">
>     <stringProp name="Argument.name">lf</stringProp>
>     <stringProp name="Argument.value">
>  </stringProp>
>     <stringProp name="Argument.metadata">=</stringProp>
>  </elementProp>
>
>  Works a treat.

Since the JMX is XXML, you could also use:

            <stringProp name="Argument.value">&#xa;</stringProp>

>
>  It's worth noting that if I attempt to edit this value now from the GUI, it
>  gets changed back to a whitespace character. But as long as I don't touch it
>  then everything works fine.
>
>  Thanks for the help seb-2-2. Much appreciated.
>
>  Cheers,
>  Nam
>
>
>
>  sebb-2-2 wrote:
>  >
>  > On 14/07/2008, nam.truong <[hidden email]> wrote:
>  >>
>  >>  Hello,
>  >>
>  >>  I would like to assign the value of a line feed character (ASCII 10) to
>  >> a
>  >>  user defined variable.
>  >>
>  >>  So far my attempt to paste the character into JMeter is only producing a
>  >>  whitespace character. The usual ALT-010 hotkey isn't working for me
>  >> either
>  >>  (this produces nothing).
>  >>
>  >>  Does anyone have a clue how this character may be set as a value?
>  >>
>  >
>  > I don't think this is possible using the GUI.
>  >
>  > You may be able to do this by editting the JMX file - create a
>  > variable and edit its value.
>  >
>  > Otherwise, the only ways I can think of are:
>  >
>  > Define a JMeter or system property as:
>  >
>  > LF=\u000a
>  >
>  > and use it as ${__P(LF)}
>  >
>  > Use Beanshell or Jexl to define the variable: vars.put("LF","\n");
>  > Use Regular Expression Post-Processor to extract a LineFeed from a
>  > response.
>  > Maybe the property "line.separator" would be suitable:
>  > ${__P(line.separator)}
>  >
>  >>  Cheers,
>  >>  Nam
>  >>
>  >> --
>  >>  View this message in context:
>  >> http://www.nabble.com/Defining-a-variable-value-of-%27line-feed%27-%28ASCII-character%29-tp18439414p18439414.html
>  >>  Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  To unsubscribe, e-mail: [hidden email]
>  >>  For additional commands, e-mail: [hidden email]
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [hidden email]
>  > For additional commands, e-mail: [hidden email]
>  >
>  >
>  >
>
>
> --
>  View this message in context: http://www.nabble.com/Defining-a-variable-value-of-%27line-feed%27-%28ASCII-character%29-tp18439414p18455791.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [hidden email]
>  For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...