Invoking local file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Invoking local file

krish na
Hi All,
i try to invoke my local json file by following below steps.
1. in HTTP Request - server name or ip - file and path is E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
When i run the scripts i got the below error:
Response code: Non HTTP response code: java.net.URISyntaxExceptionResponse message: Non HTTP response message: Illegal character in path at index 14: http://file/E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
I tried using _urlencode
E%3A%5CKrishna%5Capache-jmeter-4.0%5Capache-jmeter-4.0%5Cbin%5CSampleJson.json

Output is below:Response code: Non HTTP response code: java.net.UnknownHostExceptionResponse message: Non HTTP response message: No such host is known (file)
2. Used JSR223preprocessor with below groovy scripting:org.apache.jmeter.config.Arguments args = sampler.getArguments()sampler.getArguments().removeAllArguments()args.each {    sampler.addEncodedArgument(it.getName(), it.getValue())} Output:Response code: Non HTTP response code: java.net.URISyntaxExceptionResponse message: Non HTTP response message: Illegal character in path at index 14: http://file/E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
3.Tried to update encode value as True but the tag itself is missing in the .jmx file.

<boolProp name="HTTPArgument.always_encode">false</boolProp>
Any help will be much appreciated.
Regards,
Krishna - +91-9884451279.


CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype
Reply | Threaded
Open this post in threaded view
|

Re: Invoking local file

krish na
Adding few more options:
1. Tried to update client implementation as HttpClient4 and the output is below:
Response code: Non HTTP response code: java.net.URISyntaxExceptionResponse message: Non HTTP response message: Illegal character in path at index 14: http://file/E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
2. Tried to update client implemenation as HttpClient4 and the output is below:
Response code: Non HTTP response code: java.net.UnknownHostExceptionResponse message: Non HTTP response message: file
Looking for support to resolve the above issue.
Regards,
Krishna - +91-9884451279.

CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype

    On Friday, 10 August, 2018, 2:21:43 PM IST, krish na <[hidden email]> wrote:  
 
 Hi All,
i try to invoke my local json file by following below steps.
1. in HTTP Request - server name or ip - file and path is E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
When i run the scripts i got the below error:
Response code: Non HTTP response code: java.net.URISyntaxExceptionResponse message: Non HTTP response message: Illegal character in path at index 14: http://file/E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
I tried using _urlencode
E%3A%5CKrishna%5Capache-jmeter-4.0%5Capache-jmeter-4.0%5Cbin%5CSampleJson.json

Output is below:Response code: Non HTTP response code: java.net.UnknownHostExceptionResponse message: Non HTTP response message: No such host is known (file)
2. Used JSR223preprocessor with below groovy scripting:org.apache.jmeter.config.Arguments args = sampler.getArguments()sampler.getArguments().removeAllArguments()args.each {    sampler.addEncodedArgument(it.getName(), it.getValue())} Output:Response code: Non HTTP response code: java.net.URISyntaxExceptionResponse message: Non HTTP response message: Illegal character in path at index 14: http://file/E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
3.Tried to update encode value as True but the tag itself is missing in the .jmx file.

<boolProp name="HTTPArgument.always_encode">false</boolProp>
Any help will be much appreciated.
Regards,
Krishna - +91-9884451279.


CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype  
ZK
Reply | Threaded
Open this post in threaded view
|

Re: Invoking local file

ZK
Hi,
the problem is in the path to your json file

Try this with the HTTP Sampler:

Protocol = file
Server Name or IP = ///
Method = GET
Path = E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json

Implementation <BLANK> <- meaning empty field (maybe under 'advanced tab')




ZK




--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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

Reply | Threaded
Open this post in threaded view
|

Re: Invoking local file

krish na
Excellent thanks its working fine.
Regards,
Krishna - +91-9884451279.

CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype

    On Friday, 10 August, 2018, 2:55:34 PM IST, ZK <[hidden email]> wrote:  
 
 Hi,
the problem is in the path to your json file

Try this with the HTTP Sampler:

Protocol = file
Server Name or IP = ///
Method = GET
Path = E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json

Implementation <BLANK> <- meaning empty field (maybe under 'advanced tab')




ZK




--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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

 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking local file

jmeter tea
Thank you ZK

On Fri, Aug 10, 2018 at 12:31 PM, krish na <[hidden email]>
wrote:

> Excellent thanks its working fine.
> Regards,
> Krishna - +91-9884451279.
>
> CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype
>
>     On Friday, 10 August, 2018, 2:55:34 PM IST, ZK <
> [hidden email]> wrote:
>
>  Hi,
> the problem is in the path to your json file
>
> Try this with the HTTP Sampler:
>
> Protocol = file
> Server Name or IP = ///
> Method = GET
> Path = E:\Krishna\apache-jmeter-4.0\apache-jmeter-4.0\bin\SampleJson.json
>
> Implementation <BLANK> <- meaning empty field (maybe under 'advanced tab')
>
>
>
>
> ZK
>
>
>
>
> --
> Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Invoking local file

glinius@live.com
In reply to this post by krish na
You don't need this "http" URL scheme as you're working with the local file,
you URL should look like:


> file:///E:/Krishna/apache-jmeter-4.0/apache-jmeter-4.0/bin/SampleJson.json

Going forward be aware that there is a  Dummy Sampler
<https://www.blazemeter.com/blog/jmeters-dummy-sampler-the-ultimate-guide>  
which allows you to mimic arbitrary responses. You can use it in combination
with  __FileToString()
<https://jmeter.apache.org/usermanual/functions.html#__FileToString>  
function in order to return the content of the local file.

Dummy Sampler can be installed using JMeter Plugins Manager
<https://jmeter-plugins.org/wiki/PluginsManager/>    



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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

Reply | Threaded
Open this post in threaded view
|

Re: Invoking local file

krish na
Thanks its working fine.
Regards,
Krishna - +91-9884451279.

CallSend SMSAdd to SkypeYou'll need Skype CreditFree via Skype

    On Monday, 13 August, 2018, 12:12:39 PM IST, [hidden email] <[hidden email]> wrote:  
 
 You don't need this "http" URL scheme as you're working with the local file,
you URL should look like:


> file:///E:/Krishna/apache-jmeter-4.0/apache-jmeter-4.0/bin/SampleJson.json

Going forward be aware that there is a  Dummy Sampler
<https://www.blazemeter.com/blog/jmeters-dummy-sampler-the-ultimate-guide
which allows you to mimic arbitrary responses. You can use it in combination
with  __FileToString()
<https://jmeter.apache.org/usermanual/functions.html#__FileToString
function in order to return the content of the local file.

Dummy Sampler can be installed using JMeter Plugins Manager
<https://jmeter-plugins.org/wiki/PluginsManager/>   



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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