You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Richard Hubbell <ri...@yahoo.com> on 2007/10/03 23:49:58 UTC

leading slash in Http Request Path variable

Using latest jmeter and java.

Reading urls from a csv file and passing into the Path
for the HTTP Request

Each url in the file is like so:
http://www.example.com/

The default "HTTP Request Defaults" specify the proxy
server that the requests go through. The problem is
that jmeter inserts a leading slash before ${url} and
the proxy  just wants a GET http://www.example.com
HTTP/1.1 but jmeter is sending a GET
/http://www.example.com HTTP/1.1

Does anyone know what file to change or setting to set
to fix this?  It seems like a bug to me, but maybe
it's just a feature that doesn't make sense to me. 






      ____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
http://tv.yahoo.com/ 


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


Re: JAVA REQUEST - ${__CSVRead and NEXT VALUE

Posted by sebb <se...@gmail.com>.
That's by design - CSVRead will always start a new line for each new
thread, but will only start a new line within a thread if the thread
uses next.

Otherwise how would JMeter know if the thread had finished reading
columns from the row?

On 18/10/2007, neetu kulshrestha <na...@gmail.com> wrote:
> as per my experience with jmeter. if I use loop then it always takes first
> row but if I use threads then it takes the next value. Don't know if its by
> design or a bug
>
> On 10/4/07, Fulvio Guglielmelli <fu...@yahoo.it> wrote:
> >
> > Hi,
> >   i have a JAVA REQUEST  class with parameter
> >      a |  ${__CSVRead(try.csv,0)}
> >   whei i run the test, into the java class it always read the first ROW of
> > try.csv file.
> >
> > Into the log i saw jmeter read the next value i don't know how take it to
> > be use.
> >   I tried to use
> >        a |  ${__CSVRead(try.csv,next)}
> >      a |  ${__CSVRead(try.csv,next())}
> >   or into the java class class
> >        params.addArgument("a", "${__CSVRead(try.csv.csv,next())}");
> >
> >   but Jmeter return null value
> >   I can make in  way
> > 1) Using a loop Controller
> > 2) Using a ${__counter(,)}
> >   My problem is: HOW CAN  I PASS THE counter VALUE TO THE JAVA CLASS and
> > use it in CSVRead?
> >
> >   Could you help me?
> > FULVIO
> >
> >
> >
> > ---------------------------------
> >
> > ---------------------------------
> > L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail
>

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


Re: JAVA REQUEST - ${__CSVRead and NEXT VALUE

Posted by neetu kulshrestha <na...@gmail.com>.
as per my experience with jmeter. if I use loop then it always takes first
row but if I use threads then it takes the next value. Don't know if its by
design or a bug

On 10/4/07, Fulvio Guglielmelli <fu...@yahoo.it> wrote:
>
> Hi,
>   i have a JAVA REQUEST  class with parameter
>      a |  ${__CSVRead(try.csv,0)}
>   whei i run the test, into the java class it always read the first ROW of
> try.csv file.
>
> Into the log i saw jmeter read the next value i don't know how take it to
> be use.
>   I tried to use
>        a |  ${__CSVRead(try.csv,next)}
>      a |  ${__CSVRead(try.csv,next())}
>   or into the java class class
>        params.addArgument("a", "${__CSVRead(try.csv.csv,next())}");
>
>   but Jmeter return null value
>   I can make in  way
> 1) Using a loop Controller
> 2) Using a ${__counter(,)}
>   My problem is: HOW CAN  I PASS THE counter VALUE TO THE JAVA CLASS and
> use it in CSVRead?
>
>   Could you help me?
> FULVIO
>
>
>
> ---------------------------------
>
> ---------------------------------
> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail

Re: JAVA REQUEST - ${__CSVRead and NEXT VALUE

Posted by sebb <se...@gmail.com>.
On 04/10/2007, Fulvio Guglielmelli <fu...@yahoo.it> wrote:
> Hi,
>  i have a JAVA REQUEST  class with parameter
>     a |  ${__CSVRead(try.csv,0)}
>  whei i run the test, into the java class it always read the first ROW of try.csv file.

Because you have not used next()

The following should work:

${__CSVRead(try.csv,0)}${__CSVRead(try.csv,next)}

But the CSV Dataset element is much easier to use.

> Into the log i saw jmeter read the next value i don't know how take it to be use.
>  I tried to use
>       a |  ${__CSVRead(try.csv,next)}
>     a |  ${__CSVRead(try.csv,next())}
>  or into the java class class
>       params.addArgument("a", "${__CSVRead(try.csv.csv,next())}");
>
>  but Jmeter return null value
>  I can make in  way
> 1) Using a loop Controller
> 2) Using a ${__counter(,)}
>  My problem is: HOW CAN  I PASS THE counter VALUE TO THE JAVA CLASS and use it in CSVRead?
>  Could you help me?

What are you trying to achieve?

I don't understand what the counter has got to do with CSVRead.

> FULVIO
>
>
>
> ---------------------------------
>
> ---------------------------------
> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail

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


Re: leading slash in Http Request Path variable

Posted by sebb <se...@gmail.com>.
On 04/10/2007, Richard Hubbell <ri...@yahoo.com> wrote:
>
> --- sebb <se...@gmail.com> wrote:
> >
> > That is definitely not possible with standard Java
> > Http, because the
> > proxy is defined using system properties - and that
> > cannot be done
> > independently per thread.
> >
> > It would be possible with the HttpClient
> > implementation, but has not
> > been implemented. As far as I know, this is the
> > first time that this
> > scenario has arisen.
> >
> > We are considering implementing Proxy setup via a
> > GUI item. This would
> > probably solve your problem. But at present it's not
> > possible.
> >
>
> Darn. At least it's on the radar.  I'm seeing proxies
> more often now for different reasons and different
> uses.  Having the Proxy GUI setup as an option would
> be a big plus from my perspective.
>
> Actually if only that leading slash weren't prepended
> I think I could make it work. So if the HTTP Request
> Path variable was used as-is and a "/" wasn't
> prepended I think I could go on my merry way.  I'll
> poke around in the source for that.

As far as I know, proxies need different handling from servers, but I
suppose it might work for some simple cases.

> Thank you.
>
>
>      ____________________________________________________________________________________
> Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>
>
>
> ---------------------------------------------------------------------
> 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: leading slash in Http Request Path variable

Posted by Richard Hubbell <ri...@yahoo.com>.
--- sebb <se...@gmail.com> wrote:
> 
> That is definitely not possible with standard Java
> Http, because the
> proxy is defined using system properties - and that
> cannot be done
> independently per thread.
> 
> It would be possible with the HttpClient
> implementation, but has not
> been implemented. As far as I know, this is the
> first time that this
> scenario has arisen.
> 
> We are considering implementing Proxy setup via a
> GUI item. This would
> probably solve your problem. But at present it's not
> possible.
> 

Darn. At least it's on the radar.  I'm seeing proxies
more often now for different reasons and different
uses.  Having the Proxy GUI setup as an option would
be a big plus from my perspective.

Actually if only that leading slash weren't prepended
I think I could make it work. So if the HTTP Request
Path variable was used as-is and a "/" wasn't
prepended I think I could go on my merry way.  I'll
poke around in the source for that.
Thank you.


      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



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


JAVA REQUEST - ${__CSVRead and NEXT VALUE

Posted by Fulvio Guglielmelli <fu...@yahoo.it>.
Hi, 
  i have a JAVA REQUEST  class with parameter
     a |  ${__CSVRead(try.csv,0)}
  whei i run the test, into the java class it always read the first ROW of try.csv file.
  
Into the log i saw jmeter read the next value i don't know how take it to be use.
  I tried to use 
       a |  ${__CSVRead(try.csv,next)}
     a |  ${__CSVRead(try.csv,next())}
  or into the java class class
       params.addArgument("a", "${__CSVRead(try.csv.csv,next())}");
   
  but Jmeter return null value 
  I can make in  way
1) Using a loop Controller
2) Using a ${__counter(,)}
  My problem is: HOW CAN  I PASS THE counter VALUE TO THE JAVA CLASS and use it in CSVRead?
   
  Could you help me? 
FULVIO


       
---------------------------------

---------------------------------
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail

Re: leading slash in Http Request Path variable

Posted by sebb <se...@gmail.com>.
On 04/10/2007, Richard Hubbell <ri...@yahoo.com> wrote:
>
> --- sebb <se...@gmail.com> wrote:
> > > Wow, may well prevent using jmeter.  What if we
> > need
> > > to specify 100,000 users for the proxy?
> > >
> > > Is there a better way than to have to specify
> > 100,000
> > > jmeter command lines to test 100,000 users?  I
> > guess
> > > we could auth for one user but that's not
> > reflective
> > > of reality in this case.
> >
> > One normally only uses at most one Proxy.
> >
> > I don't understand what you are trying to do.
>
> We want to mimic multiple users and each user has to
> authenticate with the proxy. I'll use an example again
> since I don't do a great job explaining all this. If I
> use wget I specify the proxy_user and proxy_passwd for
> a request. The proxy authenticates by taking the
> user+pass and base64 encoding and then doing the Basic
> auth.  So as a workaround, that will enable us to use
> Jmeter for this, we'd run Jmeter with a
> proxy/port/user/pass on the command line. That starts
> the test using our test plan but only authenticates
> once against the proxy and that does NOT mimic the
> production reality. Hope I'm making sense, really
> appreciate the help.

That is definitely not possible with standard Java Http, because the
proxy is defined using system properties - and that cannot be done
independently per thread.

It would be possible with the HttpClient implementation, but has not
been implemented. As far as I know, this is the first time that this
scenario has arisen.

We are considering implementing Proxy setup via a GUI item. This would
probably solve your problem. But at present it's not possible.

____________________________________________________________________________________
> Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545469
>
> ---------------------------------------------------------------------
> 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: leading slash in Http Request Path variable

Posted by Richard Hubbell <ri...@yahoo.com>.
--- sebb <se...@gmail.com> wrote:
> > Wow, may well prevent using jmeter.  What if we
> need
> > to specify 100,000 users for the proxy?
> >
> > Is there a better way than to have to specify
> 100,000
> > jmeter command lines to test 100,000 users?  I
> guess
> > we could auth for one user but that's not
> reflective
> > of reality in this case.
> 
> One normally only uses at most one Proxy.
> 
> I don't understand what you are trying to do.

We want to mimic multiple users and each user has to
authenticate with the proxy. I'll use an example again
since I don't do a great job explaining all this. If I
use wget I specify the proxy_user and proxy_passwd for
a request. The proxy authenticates by taking the
user+pass and base64 encoding and then doing the Basic
auth.  So as a workaround, that will enable us to use
Jmeter for this, we'd run Jmeter with a
proxy/port/user/pass on the command line. That starts
the test using our test plan but only authenticates
once against the proxy and that does NOT mimic the
production reality. Hope I'm making sense, really
appreciate the help.



       
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

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


Re: leading slash in Http Request Path variable

Posted by sebb <se...@gmail.com>.
On 04/10/2007, Richard Hubbell <ri...@yahoo.com> wrote:
>
> --- sebb <se...@gmail.com> wrote:
> > > Here's the setup:
> > >
> > > 1.  HTTP Request Default has proxy.example.com as
> > the
> > > server variable
> >
> > The proxy needs to be defined on the command-line.
> >
> > > 2.  HTTP Request has ${url} for the Path variable
> > >
> > > But jmeter, incorrectly I believe, inserts a
> > leading
> > > slash.  Anyway I really just need to know where
> > that
> > > happens so I can modify the java that's doing
> > that.
> > > Do you happen to know?
> > >
> > > proxy.example.com is a transparent proxy only.
> > >
> > Which needs to be provided to JMeter via the
> > command-line variables.
>
> Wow, may well prevent using jmeter.  What if we need
> to specify 100,000 users for the proxy?
>
> Is there a better way than to have to specify 100,000
> jmeter command lines to test 100,000 users?  I guess
> we could auth for one user but that's not reflective
> of reality in this case.

One normally only uses at most one Proxy.

I don't understand what you are trying to do.

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


Re: leading slash in Http Request Path variable

Posted by Richard Hubbell <ri...@yahoo.com>.
--- sebb <se...@gmail.com> wrote:
> > Here's the setup:
> >
> > 1.  HTTP Request Default has proxy.example.com as
> the
> > server variable
> 
> The proxy needs to be defined on the command-line.
> 
> > 2.  HTTP Request has ${url} for the Path variable
> >
> > But jmeter, incorrectly I believe, inserts a
> leading
> > slash.  Anyway I really just need to know where
> that
> > happens so I can modify the java that's doing
> that.
> > Do you happen to know?
> >
> > proxy.example.com is a transparent proxy only.
> >
> Which needs to be provided to JMeter via the
> command-line variables.

Wow, may well prevent using jmeter.  What if we need
to specify 100,000 users for the proxy?

Is there a better way than to have to specify 100,000
jmeter command lines to test 100,000 users?  I guess
we could auth for one user but that's not reflective
of reality in this case.





      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



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


Re: leading slash in Http Request Path variable

Posted by sebb <se...@gmail.com>.
On 03/10/2007, Richard Hubbell <ri...@yahoo.com> wrote:
>
> --- sebb <se...@gmail.com> wrote:
>
> > On 03/10/2007, Richard Hubbell
> > <ri...@yahoo.com> wrote:
> > > Using latest jmeter and java.
> > >
> > > Reading urls from a csv file and passing into the
> > Path
> > > for the HTTP Request
> > >
> > > Each url in the file is like so:
> > > http://www.example.com/
> >
> > The path is supposed to contain just the path; in
> > this case /
> > The protocol and host need to be entered in
> > different fields.
>
> I probably did not explain this well, and although
> what you say is probably true and correct it doesn't
> apply in this case.
>
> Maybe an example will help.  If I use wget
>
> wget -e http_proxy=proxy.example.com
> http://www.example.com
>
> Then everything works just fine the proxy host
> (proxy.example.com here) shows it receives a
> GET http://www.example.com HTTP/1.1
>
> But if I use jmeter the proxy.example.com always gets
> a
> GET /http://www.example.com HTTP/1.1
>
> Here's the setup:
>
> 1.  HTTP Request Default has proxy.example.com as the
> server variable

The proxy needs to be defined on the command-line.

> 2.  HTTP Request has ${url} for the Path variable
>
> But jmeter, incorrectly I believe, inserts a leading
> slash.  Anyway I really just need to know where that
> happens so I can modify the java that's doing that.
> Do you happen to know?
>
> proxy.example.com is a transparent proxy only.
>
Which needs to be provided to JMeter via the command-line variables.

> >
> > > The default "HTTP Request Defaults" specify the
> > proxy
> > > server that the requests go through. The problem
> > is
> > > that jmeter inserts a leading slash before ${url}
> > and
> > > the proxy  just wants a GET http://www.example.com
> > > HTTP/1.1 but jmeter is sending a GET
> > > /http://www.example.com HTTP/1.1
> > >
> > > Does anyone know what file to change or setting to
> > set
> > > to fix this?  It seems like a bug to me, but maybe
> > > it's just a feature that doesn't make sense to me.
> > >
>
>
>
>
> ____________________________________________________________________________________
> Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545433
>
> ---------------------------------------------------------------------
> 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: leading slash in Http Request Path variable

Posted by Richard Hubbell <ri...@yahoo.com>.
--- sebb <se...@gmail.com> wrote:

> On 03/10/2007, Richard Hubbell
> <ri...@yahoo.com> wrote:
> > Using latest jmeter and java.
> >
> > Reading urls from a csv file and passing into the
> Path
> > for the HTTP Request
> >
> > Each url in the file is like so:
> > http://www.example.com/
> 
> The path is supposed to contain just the path; in
> this case /
> The protocol and host need to be entered in
> different fields.

I probably did not explain this well, and although
what you say is probably true and correct it doesn't
apply in this case. 

Maybe an example will help.  If I use wget

wget -e http_proxy=proxy.example.com
http://www.example.com  

Then everything works just fine the proxy host
(proxy.example.com here) shows it receives a
GET http://www.example.com HTTP/1.1

But if I use jmeter the proxy.example.com always gets
a
GET /http://www.example.com HTTP/1.1

Here's the setup:

1.  HTTP Request Default has proxy.example.com as the
server variable

2.  HTTP Request has ${url} for the Path variable

But jmeter, incorrectly I believe, inserts a leading
slash.  Anyway I really just need to know where that
happens so I can modify the java that's doing that.
Do you happen to know?

proxy.example.com is a transparent proxy only.


> 
> > The default "HTTP Request Defaults" specify the
> proxy
> > server that the requests go through. The problem
> is
> > that jmeter inserts a leading slash before ${url}
> and
> > the proxy  just wants a GET http://www.example.com
> > HTTP/1.1 but jmeter is sending a GET
> > /http://www.example.com HTTP/1.1
> >
> > Does anyone know what file to change or setting to
> set
> > to fix this?  It seems like a bug to me, but maybe
> > it's just a feature that doesn't make sense to me.
> >



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

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


Re: leading slash in Http Request Path variable

Posted by sebb <se...@gmail.com>.
On 03/10/2007, Richard Hubbell <ri...@yahoo.com> wrote:
> Using latest jmeter and java.
>
> Reading urls from a csv file and passing into the Path
> for the HTTP Request
>
> Each url in the file is like so:
> http://www.example.com/

The path is supposed to contain just the path; in this case /
The protocol and host need to be entered in different fields.

> The default "HTTP Request Defaults" specify the proxy
> server that the requests go through. The problem is
> that jmeter inserts a leading slash before ${url} and
> the proxy  just wants a GET http://www.example.com
> HTTP/1.1 but jmeter is sending a GET
> /http://www.example.com HTTP/1.1
>
> Does anyone know what file to change or setting to set
> to fix this?  It seems like a bug to me, but maybe
> it's just a feature that doesn't make sense to me.
>
>
>
>
>
>
>      ____________________________________________________________________________________
> Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
> http://tv.yahoo.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