jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronny Roscher <dickb...@gmail.com>
Subject Re: Embedded objects URLs contains &#34; leads to java.net.URISyntaxException: Illegal character - How to escape?
Date Mon, 03 Jun 2013 11:59:14 GMT
Im using the default HTML Parser (htmlParseer.types=text/html
application/xhtml+xml application/xml text/xml)

>From my point of view this is no JS Code because it's all outside the
<script></script> tag.

Is there a way to get this working or maybe to modify the response via
regex and replace the "?

Ronny

2013/6/3 sebb <sebbaz@gmail.com>:
> On 3 June 2013 10:12, Ronny Roscher <dickbein@gmail.com> wrote:
>>  Hi,
>>
>> as described before here is the code from the live page.
>>
>> This part works an JMeter is able to download
>> rui/images/icons/animatedlogosmall.gif.
>>
>> <table class="datatable" style="clear:left">
>> <tr>
>> <EXECUTESCRIPT>initialiseSuggInput('UCSPTOWN_SE',10,100,10000,'<img
>> id="SUGGGET" name="SUGGGET"
>> src="rui/images/icons/animatedlogosmall.gif" alt="SUGGGET"
>
> The above is actually part of script input but happens to be valid HTML.
>
>> title="Getting suggestion data. Please wait... " border="0"/>','<img
>> id="SUGGRET" name="SUGGRET" src="rui/images/icons/16x16/refresh.png"
>> alt="SUGGRET" title="Refresh suggestions for this input field. "
>> border="0"/>','more to display','[]','          ');</EXECUTESCRIPT>
>> </tr>
>> </table>
>>
>> The following part ist from the same page only some lines below. Here
>> for example the record.png were JMeter is not able to download.
>>
>> <EXECUTESCRIPT>displayVRWidget({"content":"<a
>> id=&#34;vrVRSTARTlink&#34; onclick=&#34;executeHref(this);return
>> false;&#34; href=&#34;javascript:executeVRCommand('*VRSTART',0);&#34;><img
>> id=&#34;VRRECORD&#34; name=&#34;VRRECORD&#34;
>> src=&#34;rui/images/icons/cti/record.png&#34; alt=&#34;VRRECORD&#34;
>
> That is also input to a script but is not valid HTML.
>
>> title=&#34;Aufnahme starten &#34; border=&#34;0&#34;/></a><img
>> id=&#34;VRSTOP_D&#34; name=&#34;VRSTOP_D&#34;
>> src=&#34;rui/images/icons/cti/stop.png&#34; alt=&#34;VRSTOP_D&#34;
>> title=&#34;Stopp ist deaktiviert &#34;
>> border=&#34;0&#34;/>","interval":0,"initialState":"collapsed"});</EXECUTESCRIPT>
>> <form name="fKPWidget" id="fKPWidget"
>> enctype="application/x-www-form-urlencoded; charset=UTF-8"
>> method="post" action="XR0001.pgm">
>>
>> Here the error message
>>
>> java.net.URISyntaxException: Illegal character in path at index 21:
>> http://172.25.22.199/"rui/images/icons/cti/record.png"
>>  at java.net.URI$Parser.fail(Unknown Source)
>>  at java.net.URI$Parser.checkChars(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:234)
>>  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
>>  at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.downloadPageResources(HTTPSamplerBase.java:1207)
>
> Which HTML parser are you using?
> It is defined in jmeter.properties and may be logged (cannot remember offhand).
>
> Note that JMeter does not process Javascript.
> The fact that it sees the src="" tag in the first script is purely
> because the script happens to have valid HTML buried in it.
>
>> Regards
>>
>> Ronny
>>
>>
>> 2013/5/28 Ronny Roscher <dickbein@gmail.com>:
>>> Currently I have no access to the system.
>>> But the code is from a Coraltree RNS system.
>>>
>>> There is a demo available at http://rns.coraltree.co.uk (Login demo/demo).
>>> The error doesn't occur there but the above mentioned notation is also used.
>>>
>>> See following example which is compareable to my problem. (this is the
>>> source of xr0001.pgm from the above mentioned url)
>>> <script>
>>> ...
>>> if (!$('#themechanger')[0]) {
>>> $('<div></div>')
>>> .attr('id','themechanger')
>>> .css('position','relative')
>>> .css('z-index',10)
>>> .appendTo('#widgetsArea')
>>> .themechanger({"content":"<select class=&#34;ui-themechanger-ddl&#34;>"
+
>>> "<option value=&#34;rui/styles/black-tie/jquery-ui-1.8.23.custom.css?v=5.10e&#34;
>>>>Black Tie</option>" +
>>> "<option value=&#34;rui/styles/blitzer/jquery-ui-1.8.23.custom.css?v=5.10e&#34;
>>>>Blitzer</option>" +
>>> "<option value=&#34;rui/styles/cupertino/jquery-ui-1.8.23.custom.css?v=5.10e&#34;
>>>>Cupertino</option>" +
>>> "<option value=&#34;styles/customised/kbw/jquery-ui-1.8.23.custom.css?v=5.10e&#34;
>>>>KBW</option>" +
>>> "<option value=&#34;rui/styles/dark-hive/jquery-ui-1.8.23.custom.css?v=5.10e&#34;
>>>>Dark Hive</option>" +
>>> ...
>>> </script>
>>>
>>> Unfortunately I will be not able before next monday to give you an the
>>> exact erroneous sample.
>>>
>>> Regards
>>>
>>> Ronny
>>>
>>> 2013/5/28 sebb <sebbaz@gmail.com>:
>>>> On 28 May 2013 21:10, Ronny Roscher <dickbein@gmail.com> wrote:
>>>>> Why is this not valid?
>>>>> From my point of view this is the default special char encoding.
>>>>>
>>>>> The browser is able to encode &#34; to " is's the same like &uuml;
and
>>>>> &szlig; or the german umlaute &auml;, &uuml; and &ouml;
>>>>>
>>>>> Have a look at the ascii table
>>>>>
>>>>> http://www.torsten-horn.de/techdocs/ascii.htm
>>>>>
>>>>> Remeber that I added the backslash (\) before \$#34; to prevent the
>>>>> browser/mailclient to encode this to "
>>>>>
>>>>> One last thing. When this is not valid. Why the browser is able to
>>>>> display it correct?
>>>>
>>>> As I already wrote, please provide the context in which the src
>>>> attribute references appear.
>>>>
>>>>> Ronny
>>>>>
>>>>>
>>>>> 2013/5/28 sebb <sebbaz@gmail.com>:
>>>>>> On 28 May 2013 20:07, Ronny Roscher <dickbein@gmail.com> wrote:
>>>>>>> This is just because the (this) browser translate \&#34;
to " when not
>>>>>>> escaped with \
>>>>>>>
>>>>>>> So the two sources differs but the mail translated/encoded them
:)
>>>>>>>
>>>>>>> The original looks as follows
>>>>>>>
>>>>>>> works: src="rui/images/icons/16x16/refresh.png"
>>>>>>>
>>>>>>> fails: src=\&#34;rui/images/icons/cti/record.png\&#34;
>>>>>>
>>>>>> That's not valid HTML.
>>>>>>
>>>>>>>
>>>>>>> \ in front of \&#34; added by me to prevent encoding to "
>>>>>>>
>>>>>>> Hope it's clearer now.
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Ronny
>>>>>>>
>>>>>>>
>>>>>>> Am 28.05.2013 20:44 schrieb "sebb" <sebbaz@gmail.com>:
>>>>>>>
>>>>>>>> On 24 May 2013 12:10, Ronny Roscher <dickbein@gmail.com>
wrote:
>>>>>>>> > Hi
>>>>>>>> >
>>>>>>>> > I have a HTTP Sampler calling http://1.2.3.4/test.html
and checked the
>>>>>>>> box
>>>>>>>> > for downloading all embedded objects.
>>>>>>>> >
>>>>>>>> > Some of them work but some of them fails due to strange/wrong
character
>>>>>>>> > encoding in the response
>>>>>>>> >
>>>>>>>> > works: src="rui/images/icons/16x16/refresh.png"
>>>>>>>> > fails: src="rui/images/icons/cti/record.png"
>>>>>>>>
>>>>>>>> I don't see how the second one differs from the first.
>>>>>>>>
>>>>>>>> > java.net.URISyntaxException: Illegal character in path
at index 21:
>>>>>>>> > http://1.2.3.4/"rui/images/icons/cti/record.png"
>>>>>>>> >
>>>>>>>> > is there a way to escape/replace " in the response?
>>>>>>>>
>>>>>>>> Seems to me that the HTML response is broken.
>>>>>>>> Can you provide the actual source for the two image references?
>>>>>>>>
>>>>>>>> [You don't have to provide the whole page, just enough context
to show
>>>>>>>> the embedded references]
>>>>>>>>
>>>>>>>> > Thanks in advance
>>>>>>>> >
>>>>>>>> > Ronny
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Mime
View raw message