You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using http-unit 1.7.3, I am trying to set a hidden field parameter. As calling WebForm.setParameter() throws an exception on hidden field, I am calling WebForm.getScriptableObject().setParameterValue() which was working in version 1.6.2.
After upgrading, this no longer works because of the exception.
I also tried WebForm.newScriptable().set() but it does nothing (traced in code and ends up not calling any other methods).
Need help to solve this problem.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Could you please supply a unit test showing the difference in expected and actual behavior. E.g. FormSubmitTest.testFormProperties might be an example where getScriptableObject() is being used.
The line in comment is the code that works for all form parameters except for hidden parameters. For hidden parameters, WebForm.setParameter() throws an exception, so you have to resort to going through the getScriptableObject() but it seems there is a bug in 1.7.3 that throws a ClassCastException when calling the getScriptableObject() when Javascript is turned off.
I understand that calling getScriptableObject() is weird when javascript support is turned off but it worked up to version 1.6.2 and again since WebForm.setParameter() throws an exception on hidden fields, there does not seem to be any other options.
Sadly, turning on javascript is not an option as we get very unstable behavior (forms that get be fetched by name but not by ID, buttons that disappear, javascript errors). Turning off javascript has always made it much simpler to test the actual logic.
Using http-unit 1.7.3, I am trying to set a hidden field parameter. As calling WebForm.setParameter() throws an exception on hidden field, I am calling WebForm.getScriptableObject().setParameterValue() which was working in version 1.6.2.
After upgrading, this no longer works because of the exception.
I also tried WebForm.newScriptable().set() but it does nothing (traced in code and ends up not calling any other methods).
Need help to solve this problem.
Thanks in advance!
The text was updated successfully, but these errors were encountered: