问题
I've just found a proxy somewhere and applied to my code, seem to be successful. But when it comes down to submit("btnG"), I got an syntax error SyntaxError:
syntax error (httpunit; line 155)
at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:597)
at org.mozilla.javascript.TokenStream.reportSyntaxError(TokenStream.java:1324)...
回答1:
Submit from net.sourceforge.jwebunit.junit.WebTestCase is deprecated, so if this is what you are trying to use then you will have some issues
public void submit()
Deprecated.
Submit form - default submit button will be used (unnamed submit button, or named button if there is only one on the form.
submit
public void submit(String buttonName)
Deprecated.
Submit form by pressing named button.
Parameters:
buttonName - Submit button name attribut value.
submit
public void submit(String buttonName, String buttonValue)
Deprecated.
Submit the form by pressing the named button with the given value (label). Useful if you have more than one submit button with same name.
Parameters:
buttonName - Submit button name attribut value.
buttonValue - Submit button value attribut value.
来源:https://stackoverflow.com/questions/8982551/getting-java-io-ioexception-when-running-junit-test-case-in-eclipse-continued