Hi, the error comes from a page or script that refers to a javascript file that doesn't exist.
In fact I (now) think that HtmlUnit should cause a script exception in such a case because browsers don't but simply notify the - possible - incorrectness that WebTest for instance could listen to and display. This has been changed in HtmlUnit for a few days and will come into WebTest once a new release of HtmlUnit is available. In the mean time you can configure WebTest to ignore js errors or just drop a nightly build of HtmlUnit in your WebTest lib dir in place of HtmlUnit-1.13.jar. Happy Testing, Marc. Jayasudha Selvaraj wrote: > Hi, > > > > I am trying to test the login of my portal using webtest. It’s just a > simple check for username and password but don't > > know why it displays error. I'm using the scripts as given in user guide > (using the same webTest.xml. ) The script for login page test is > > as follows: > > > > *allTests.xml* > > * * > > <?xml version="1.0"?> > > > > <project name="WebTestDemo-allTests" default="test"> > > <target name="test" description="runs all the tests"> > > <ant antfile="googleWebTest.xml"/> > > </target> > > </project> > > > > > > I’ve used the same name “googleWebTest.xml” as given in user guide. And > googleWebTest.xml is as follows: > > > > *googleWebTest.xml* > > * * > > <?xml version="1.0"?> > > > > <!DOCTYPE project SYSTEM "../dtd/Project.dtd"> > > > > <project name="demo.googleWebTest" default="test"> > > > > <target name="test"> > > > > <webtest name="Optrak Home page test"> > > <invoke url="http://www.mylogin.com"/> > > <setInputField name="_58_login" value=""/> > > <setInputField name="_58_login" value="aaaaa"/> > > <setInputField description="Set password field _58_password: > 1234" name="_58_password" value="1234"/> > > <clickButton label="Sign In"/> > > </webtest> > > > > </target> > > </project> > > > > When I test it, the test report showed that the test has failed and the > error I have got is as follows > > > > Error > > Message > > JavaScript error loading page http://www.mylogin.com: 404 > /html/js/portlet/messaging.js for > http://www.mylogin.com/html/js/portlet/messaging.js > > Location > > C:\Canoo WebTest\Lift\tests\googleWebTest.xml (line: 10) > > Details > > javascript error 404 /html/js/portlet/messaging.js for > http://www.mylogin.com/html/js/portlet/messaging.js > > > > > > line -1 > > > > > > javascript source > > > > > > failing line <no source> > > > > > > javascript call stack 404 /html/js/portlet/messaging.js for > http://www.mylogin.com/html/js/portlet/messaging.js > > > > When I looked at the resulting page, it showed the page with a different > username on default. The username is not getting overwritten. I also > tried giving username and password (actual username and password not > given here) directly in invoke, it dint help. One more thing is that the > base URL is www.mylogin.com . when I enter, it gets redirected to a > different URL- www.mylogin.com/web/guest/home > <http://www.mylogin.com/web/guest/home>. I also tried with this URL, but > it displays the same error. > > > > Can anyone help me with this plz? > > > > Thanks > > -Jai > -- Blog: http://mguillem.wordpress.com _______________________________________________ WebTest mailing list [email protected] http://lists.canoo.com/mailman/listinfo/webtest

