• Post Reply Bookmark Topic Watch Topic
  • New Topic

iframe not supported for jwebUnit  RSS feed

 
y spektory
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any of you know jWebUnit or HttpUnit?

i am running a very simple code (here is a snippet)
the html code is this:

the iframe is this:

<form action="TypeMultiple.jsp" method="post" name="stuffform">
<input type="checkbox" name="is_correct" value="1" >
correct answer

<input type="submit" name="Submit" class=button value="submit">
</form>


the root frame includes:

<iframe name="addanswer" src="../cms/TypeMultiple.jsp?&redirected=1" width="100%" height="500" marginwidth=0 marginheight=0 frameborder=0 scrolling=yes></iframe>

the jWebUnit code includes this:

beginAt("/myPage.jsp");
assertTitleEquals("myTitle");
assertFramePresent("addanswer");//not needed, but i wanted to be sure
gotoFrame("addanswer");

this works fine, but when i add:
setWorkingForm("stuffform");
OR
assertFormElementPresent("is_correct");
it fails either because :

net.sourceforge.jwebunit.UnableToSetFormException: Attempted to set form to null.
at net.sourceforge.jwebunit.HttpUnitDialog.setWorkingForm(HttpUnitDialog.java:248)


OR

junit.framework.AssertionFailedError: Did not find form element with name [is_correct].
at junit.framework.Assert.fail(Assert.java:47)

i have searched through the documetnation and saw there was a patch for iframe in the case of onload() on the previous release, but it doesn't solve my problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!