You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Harry_ <ha...@gmail.com> on 2009/11/30 18:45:34 UTC

All the pages are returned as unauthorized when accessed through proxy using ant

Hi,

I am testing a server which is accesses via proxy. I start jMeter using -H
and -P param like :

 sh jmeter -H 10.81.40.1 -P 80

Open the test plan and start running it. It hits various http URL's from the
csv file and shown me the responses correctly. All works fine here... :)

But now when I run the test through jmeter task using ant by passing
proxyHost and proxyPass arguments like:
        <jmeter jmeterhome="${jmeter.dir}"
	 testplan="${jmeter.file.path}/${jmeter.file.name}.jmx"
	
resultlog="${results}/${jmeter.file.name}${testType}${iterationID}${fileID}.${jMeterResultFileExtension}"
	 proxyHost="10.81.40.1"
	 proxyPort="80">
            <property name="serverToTest" value="${serverToTest}"/>
            <property name="jmeter.save.saveservice.output_format"
value="xml"/>
            <property name="jmeter.save.saveservice.assertion_results"
value="all"/>
            <property name="request.threads" value="${request.threads}"/>
            <property name="request.loop" value="${request.loop}"/>            
            <property name="request.csvfile"
value="${request.csvfile}${fileID}"/>
            <jvmarg value="-Duser.dir=${test.dir}"/>
        </jmeter>

The proxy does not require user name and password. So haven't supplied those
arguments (Even though I have tried passing empty userName and userPass). 

But all the request response returns the following unauthorized error:

Thread Name: Non Logged on User Thread Group 1-1
Sample Start: 2009-11-30 18:55:53 UTC
Load time: 65
Latency: 65
Size in bytes: 401
Sample Count: 1
Error Count: 1
Response code: 401
Response message: Unauthorized

Response headers:

HTTPSampleResult fields:
ContentType: 
DataEncoding: null


Can anyone tell me what else do I need to do so that I do not get this
unauthorized error. I need to resolve this problem really urgent as we have
to start our performance test tomorrow and this error is totally stopping us
from doing it. 

Regards
-- 
View this message in context: http://old.nabble.com/All-the-pages-are-returned-as-unauthorized-when-accessed-through-proxy-using-ant-tp26578812p26578812.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


Re: All the pages are returned as unauthorized when accessed through proxy using ant

Posted by Harry_ <ha...@gmail.com>.
Thanks for the reply sebb...

The problem was with the settings in HTTP Authorization Manager. I did the
changes in the test file for testing through UI, But not for the test plan
which is called through ant. Did the changes now. It works fine.... 

Everything is working fine now.... :) 

Thanks and Regards


sebb-2-2 wrote:
> 
> On 30/11/2009, Harry_ <ha...@gmail.com> wrote:
>>
>>  Hi,
>>
>>  I am testing a server which is accesses via proxy. I start jMeter using
>> -H
>>  and -P param like :
>>
>>   sh jmeter -H 10.81.40.1 -P 80
>>
>>  Open the test plan and start running it. It hits various http URL's from
>> the
>>  csv file and shown me the responses correctly. All works fine here... :)
> 
> So the problem is not with JMeter, though you should double-check by
> running JMeter in non-GUI mode, i.e.
> 
> sh jmeter -H 10.81.40.1 -P 80 -n -t testfile.jmx -l testfile.jtl
> 
>>  But now when I run the test through jmeter task using ant by passing
>>  proxyHost and proxyPass arguments like:
>>         <jmeter jmeterhome="${jmeter.dir}"
>>          testplan="${jmeter.file.path}/${jmeter.file.name}.jmx"
>>
>> 
>> resultlog="${results}/${jmeter.file.name}${testType}${iterationID}${fileID}.${jMeterResultFileExtension}"
>>          proxyHost="10.81.40.1"
>>          proxyPort="80">
>>             <property name="serverToTest" value="${serverToTest}"/>
>>             <property name="jmeter.save.saveservice.output_format"
>>  value="xml"/>
>>             <property name="jmeter.save.saveservice.assertion_results"
>>  value="all"/>
>>             <property name="request.threads" value="${request.threads}"/>
>>             <property name="request.loop" value="${request.loop}"/>
>>             <property name="request.csvfile"
>>  value="${request.csvfile}${fileID}"/>
>>             <jvmarg value="-Duser.dir=${test.dir}"/>
>>         </jmeter>
>>
>>  The proxy does not require user name and password. So haven't supplied
>> those
>>  arguments (Even though I have tried passing empty userName and
>> userPass).
>>
>>  But all the request response returns the following unauthorized error:
> 
> Therefore the problem must be in JMeterAnt, which is not maintained by
> the JMeter committers.
> 
> Are you using the latest version of JMeterAnt?
> 
> Jmeter will log the proxy settings in jmeter.log, for example:
> 
> jmeter.JMeter: Set http[s].proxyHost: 10.81.40.1 Port: 80
> 
> Check this in the log file when using Ant and when not using Ant.
> 
>>  Thread Name: Non Logged on User Thread Group 1-1
>>  Sample Start: 2009-11-30 18:55:53 UTC
>>  Load time: 65
>>  Latency: 65
>>  Size in bytes: 401
>>  Sample Count: 1
>>  Error Count: 1
>>  Response code: 401
>>  Response message: Unauthorized
>>
>>  Response headers:
>>
>>  HTTPSampleResult fields:
>>  ContentType:
>>  DataEncoding: null
>>
>>
>>  Can anyone tell me what else do I need to do so that I do not get this
>>  unauthorized error. I need to resolve this problem really urgent as we
>> have
>>  to start our performance test tomorrow and this error is totally
>> stopping us
>>  from doing it.
>>
>>  Regards
>>
>> --
>>  View this message in context:
>> http://old.nabble.com/All-the-pages-are-returned-as-unauthorized-when-accessed-through-proxy-using-ant-tp26578812p26578812.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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/All-the-pages-are-returned-as-unauthorized-when-accessed-through-proxy-using-ant-tp26578812p26579451.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


Re: All the pages are returned as unauthorized when accessed through proxy using ant

Posted by sebb <se...@gmail.com>.
On 30/11/2009, Harry_ <ha...@gmail.com> wrote:
>
>  Hi,
>
>  I am testing a server which is accesses via proxy. I start jMeter using -H
>  and -P param like :
>
>   sh jmeter -H 10.81.40.1 -P 80
>
>  Open the test plan and start running it. It hits various http URL's from the
>  csv file and shown me the responses correctly. All works fine here... :)

So the problem is not with JMeter, though you should double-check by
running JMeter in non-GUI mode, i.e.

sh jmeter -H 10.81.40.1 -P 80 -n -t testfile.jmx -l testfile.jtl

>  But now when I run the test through jmeter task using ant by passing
>  proxyHost and proxyPass arguments like:
>         <jmeter jmeterhome="${jmeter.dir}"
>          testplan="${jmeter.file.path}/${jmeter.file.name}.jmx"
>
>  resultlog="${results}/${jmeter.file.name}${testType}${iterationID}${fileID}.${jMeterResultFileExtension}"
>          proxyHost="10.81.40.1"
>          proxyPort="80">
>             <property name="serverToTest" value="${serverToTest}"/>
>             <property name="jmeter.save.saveservice.output_format"
>  value="xml"/>
>             <property name="jmeter.save.saveservice.assertion_results"
>  value="all"/>
>             <property name="request.threads" value="${request.threads}"/>
>             <property name="request.loop" value="${request.loop}"/>
>             <property name="request.csvfile"
>  value="${request.csvfile}${fileID}"/>
>             <jvmarg value="-Duser.dir=${test.dir}"/>
>         </jmeter>
>
>  The proxy does not require user name and password. So haven't supplied those
>  arguments (Even though I have tried passing empty userName and userPass).
>
>  But all the request response returns the following unauthorized error:

Therefore the problem must be in JMeterAnt, which is not maintained by
the JMeter committers.

Are you using the latest version of JMeterAnt?

Jmeter will log the proxy settings in jmeter.log, for example:

jmeter.JMeter: Set http[s].proxyHost: 10.81.40.1 Port: 80

Check this in the log file when using Ant and when not using Ant.

>  Thread Name: Non Logged on User Thread Group 1-1
>  Sample Start: 2009-11-30 18:55:53 UTC
>  Load time: 65
>  Latency: 65
>  Size in bytes: 401
>  Sample Count: 1
>  Error Count: 1
>  Response code: 401
>  Response message: Unauthorized
>
>  Response headers:
>
>  HTTPSampleResult fields:
>  ContentType:
>  DataEncoding: null
>
>
>  Can anyone tell me what else do I need to do so that I do not get this
>  unauthorized error. I need to resolve this problem really urgent as we have
>  to start our performance test tomorrow and this error is totally stopping us
>  from doing it.
>
>  Regards
>
> --
>  View this message in context: http://old.nabble.com/All-the-pages-are-returned-as-unauthorized-when-accessed-through-proxy-using-ant-tp26578812p26578812.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