Hi Rachel,
I understand you are looking at jWebUnit now but if you
decide to look at WebTest again, here is what I found.
Having looked at the tapestry js file, I suspect that
the error is actually in the login page (i.e. whatever
"/login/app" points to not the form). I suspect that
either (A) the new page has an onload function with a slight
bug, or (B) HtmlUnit doesn't quite handle the JavaScript
contained within the onload. You might find that jWebUnit
(via HttpUnit) hasn't attempted to run the onload - so you
won't see the issue - but neither will you be able to test
whether that page's initialisation is working correctly.
Then again, this could be an area where HttpUnit is working
better than HtmlUnit.
To rule out (A) you could look in the JavaScript console
of your browser - browsers will appear to work even if
there is an error in onload.
To go forward with WebTest you could try setting the
following option in WebTest (as a subelement of config):
<option name="ThrowExceptionOnScriptError" value="false"/>
Happy testing whichever path you follow.
Regards, Paul.
Rachel Swailes wrote:
Hi there,
I'm getting started with webtest and I've written a small test to test
the login page of the application I'm working on. It's a simple login
page with the username and password field and a login button.
The relevant piece is...
<clickButton description="Try login with good details"
label="Login" />
<verifyText description="Should get into the center"
text="Center Main Page" />
When the process gets to the part about clicking the button, it gives me
this error (again, the relevant piece)
[webtest] 2006/02/03 03:03:31
org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
[webtest] INFO: Redirect requested but followRedirects is disabled
[webtest] (request.TargetHelper) 80 ) ScriptException: enclosed
exception was "Can't find enclosing select element"
[webtest] (steps.Step 420 ) Exception thrown from this
class: com.canoo.webtest.engine.StepFailedException
I have another test that clicks on this button with bad login info to
test that the login should fail and that test works fine. This test (the
one that is generating the errors above) is given good login data and is
supposed to check that the login works.
The only info I can find online is that it could be something to do with
the javascript that is called to verify the login. But I don't know what
I would need to change in order to get this test to work.
Any advise would be greatly appreciated!
Rachel
Btw: Appologies if this came through twice, I sent it once before I
subscribed and it didn't get through...
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest