Jython/Grinder/Grinderstone:无法将 self arg 强制为 net.grinder.plugin.http.HTTPUtilities

发布于 2024-09-26 13:00:50 字数 856 浏览 3 评论 0原文

过去几天我一直在构建的磨床脚本到目前为止一直运行良好。我收到一个运行时错误,最初说:

    self.token___LASTFOCUS = HTTPUtilities.valueFromHiddenInput('__LASTFOCUS')       
TypeError: valueFromHiddenInput(): expected 2-3 args; got 1

所以我添加了 [另一个 arg][1],我知道的东西会在脚本的开头,并得到一个稍微更有用的错误。虽然现在我不知道该怎么办,

    self.token___LASTFOCUS = HTTPUtilities.valueFromHiddenInput('__LASTFOCUS', '')       
TypeError: valueFromHiddenInput(): self arg can't be coerced to net.grinder.plugin.http.HTTPUtilities

知道为什么“自我”没有被强迫吗?

[1]: http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPUtilities.html#valueFromHiddenInput(java.lang.String, java.lang.String)

A grinder script i have been building out for the past few days has been working pretty well up until just now. I am getting a runtime error initially saying:

    self.token___LASTFOCUS = HTTPUtilities.valueFromHiddenInput('__LASTFOCUS')       
TypeError: valueFromHiddenInput(): expected 2-3 args; got 1

so i added [another arg][1], something i knew would be at the beginning of the script, and got a slightly more useful error. Although now I am not sure what to do with this

    self.token___LASTFOCUS = HTTPUtilities.valueFromHiddenInput('__LASTFOCUS', '')       
TypeError: valueFromHiddenInput(): self arg can't be coerced to net.grinder.plugin.http.HTTPUtilities

Any idea why 'self' isn't being coerced?

[1]: http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPUtilities.html#valueFromHiddenInput(java.lang.String, java.lang.String)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉宸 2024-10-03 13:00:50

找到了我需要这些行的答案

from net.grinder.plugin.http import HTTPPluginControl
httpUtilities = HTTPPluginControl.getHTTPUtilities()

看起来 HTTPUtilities 可能是单例或具有工厂方法。
不确定具体的架构是什么。

found the answer i needed these lines

from net.grinder.plugin.http import HTTPPluginControl
httpUtilities = HTTPPluginControl.getHTTPUtilities()

It looks like HTTPUtilities might be a singleton or has a factory method.
Not to sure on what that specific architecture is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文