Error parsing URL with variables for host and port

1,966 views
Skip to first unread message

bpr...@gmail.com

unread,
Mar 21, 2016, 5:58:13 PM3/21/16
to codename-taurus
I'm working on a Taurus test where I'm trying to validate a request where the host and port change.

Ideally, I would like to use something like this in my scenario request: http://${host}:${port}/somefile.php

But, Taurus seems to have trouble parsing this URL.
  • If I run the test with the above URL, I see the following error: invalid literal for int() with base 10: '${port}'
  • If I hardcode the host and not the port or hardcode the port and not the host, I see the following error:
    • Response code: Non HTTP response code: java.net.URISyntaxException
    • Response message: Non HTTP response message: Illegal character in authority
I've also tried manually escaping characters in the URL but to no avail.

Has anyone worked on a test where the host and port in the request are dynamic?  If so, how did you handle this situation?

ta...@blazemeter.com

unread,
Mar 22, 2016, 1:36:13 AM3/22/16
to codename-taurus
Hi, Brian
Your problem was discussed some treads ago (https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/codename-taurus/qLGfkdbP6qk)
Yes, this is a bug caused by combination of variables and jmeter requests. We'll fix it in nearest release (in 1-2 weeks).

Brian Prusko

unread,
Mar 22, 2016, 11:53:52 AM3/22/16
to codename-taurus
Thanks!

Andrey Pokhilko

unread,
Mar 22, 2016, 12:19:28 PM3/22/16
to codenam...@googlegroups.com
1.3.1 with the fix has just been released, upgrade and try again

Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/b140d9a8-b44b-4b5d-bcfd-0526c7cb673f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Prusko

unread,
Mar 22, 2016, 1:39:12 PM3/22/16
to codename-taurus
Andrey,

I upgraded to 1.3.1, and here's what I'm seeing when I try to make the request:

Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Illegal character in authority at index 7:  http://${host}/directory/file.php

java.net.URISyntaxException: Illegal character in authority at index 7:  http://${host}/directory/file.php
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.parseAuthority(Unknown Source)
at java.net.URI$Parser.parseHierarchical(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.<init>(Unknown Source)
at java.net.URL.toURI(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Unknown Source)


This is the URL I specify in my scenario: http://${host}:${port}/directory/file.php

In the results tree, this is the request I see getting made: POST http://${host}/directory/file.php

I get the host and port number in the scenario that runs immediately before this one, and I have verified that I am getting both of those values.

Andrey Pokhilko

unread,
Mar 22, 2016, 1:41:38 PM3/22/16
to codenam...@googlegroups.com
That error means that replacement of variable does not happen inside JMeter. This means that variable was not defined in JMeter at the moment it was queried.

Can you share your config file with us to suggest you possible way out of it?


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.

Brian Prusko

unread,
Mar 22, 2016, 4:00:39 PM3/22/16
to codename-taurus
For anyone else who visits this thread, my issue was resolved by making the variables in the URL lowercase.

In my actual request (the request referenced above is a generic dummy request), I was using camel-case variables.
Reply all
Reply to author
Forward
0 new messages