简体   繁体   中英

Jython/Grinder/Grinderstone: self arg can't be coerced to net.grinder.plugin.http.HTTPUtilities

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM