gpt4 book ai didi

java - JMeter:java.net.URISyntaxException:索引处格式错误的转义对

转载 作者:行者123 更新时间:2023-12-02 04:01:42 32 4
gpt4 key购买 nike

我正在 JMeter 中重新编码一个场景,其中用户搜索记录,列出结果后,单击 Excel 图标以下载 .xls 格式的结果,但当我在录制时单击“Excel”图标时,会显示以下错误。

java.net.URISyntaxException: Malformed escape pair at index 336: https://mylink.myURL.com/Change/ExportHandler?objChanger=ANK,All%20Products,A,Jan-2015,Jan-2016,Country,India,,,1&tableName=datatable-example5&iSortCol_0=2&sSortDir_0=desc&aoColumns=Name,Salesa,Salesb,Share,&Header=Name,ABC%20FM%20Gross%20Sales%20(lakhs),Industry%20Gross%20Sales%20(lakhs),share%20share%20(%),
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.scanEscape(Unknown Source)
at java.net.URI$Parser.scan(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: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.proxy.Proxy.run(Proxy.java:240)

Google 上的解决方案是将 URL 中的 % 替换为 25,有人可以帮我解决这个问题,例如如何对 URL 进行编码。

谢谢!

最佳答案

JMeter 提供 __urlEncode()该函数旨在转义 URL 中不允许的特殊字符。

您可以使用Function Helper Dialog可从菜单 -> 选项确保使用正确的语法

Function Helper Dialog

参见How to Use JMeter Functions有关此功能和其他有用的 JMeter 功能的综合信息的帖子系列。

关于java - JMeter:java.net.URISyntaxException:索引处格式错误的转义对,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34824948/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com