[Webtest] Question about moving Webtest early release to current release?

Marc Guillemot webtest@lists.canoo.com
Tue, 12 Jul 2005 16:44:13 +0200


Hi,

you have a js error:
Cannot read property "offsetTop" from undefined (scripts/adminUtils.js#874)

You have to look at the js script to understand on which object the
property offsetTop was read and why htmlunit doesn't find it. I guess
that you didn't have such a problem previously because httpunit didn't
even execute this javascript code.

Marc.

Tize Ma wrote:

> Thank you very much, Marc.
>
> My problem looks similar to that in another message (by Gooshy
> Gooshy). In the section where the step fails I have
>
> <setInputField description="Set the Username"
>
> name="j_username"
>
> value="${admin.username}" />
>
> <setInputField description="Set the password"
>
> name="j_password"
>
> value="${admin.password}" />
>
> <clickButton description="Submit the admin login form"
>
> name="submit1"/>
>
> Those properties are defined in a properties file.
>
> The console output is like:
>
> [testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step:
> setInputField "Set the Username" (4/30)
>
> [testSpec] INFO (com.canoo.webtest.engine.Context) - Current form set
> to (action=j_security_check)
>
> [testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step:
> setInputField "Set the password" (5/30)
>
> [testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step:
> clickButton "Submit the admin login form" (6/30)
>
> [testSpec] INFO (com.canoo.webtest.steps.request.ClickButton) - ->
> gotoTarget(by input): name=submit1 value=Login
>
> [testSpec] INFO (org.apache.commons.httpclient.HttpMethodDirector) -
> Redirect requested but followRedirects is disabled
>
> [testSpec] INFO (org.apache.commons.httpclient.HttpMethodDirector) -
> Redirect requested but followRedirects is disabled
>
> [testSpec] ERROR (com.canoo.webtest.steps.request.Target) -
> ScriptException: enclosed exception was "Wrapped
> com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read
> property "offsetTop" from undefined (scripts/adminUtils.js#874)"
>
> [testSpec] INFO (com.canoo.webtest.steps.Step) - Exception thrown from
> this class: com.canoo.webtest.engine.StepFailedException
>
> [testSpec] INFO (com.canoo.webtest.steps.Step) - Message was:
> Step[clickButton "Submit the admin login form" (6/30)]: Script error
> executing at: clickbutton
>
> [testSpec] INFO (com.canoo.webtest.ant.TestSpecificationTask) -
> Writing report using Report class: com.canoo.webtest.reporting.XmlReporter
>
> It looks like the main problem here is that the property "offsetTop"
> is undefined. Somehow, the previous build of Webtest and IE seem to be
> fine with it.
>
> Thanks again.
>
> Tize
>
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com] On Behalf Of Marc Guillemot
> Sent: 2005年7月12日 7:32
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] Question about moving Webtest early release to
> current release?
>
> Hi,
>
> the messages from parser are only informative and not allways very
> good. These parser errors are not the cause of the
>
> failing tests. You have to look at the step that fails and the
> associated messages to find the origin of the problem.
>
> Marc.
>
> Tize Ma wrote:
>
>> Hi, all,
>
>> I am trying to move Canoo Webtest release 457 (httpunit) to 916
>
>> (htmlunit). (Old release works great, but it is probably the time to
>
>> move to the new one) . The problem I face is that all tests that run
>
>> with build 457 do not run now. After I turn on showhtmlparseroutput in
>
>> config, I got a lot of errors like,
>
>> <error col="67" line="5"
>
>> url="http://ReTma:8080/rware/admin/frames.html">Missing whitespace
>
>> before attribute "SCROLLING".</error>
>
>> And much more warnings.
>
>> I experimented with option tag in the config with JavaScriptEnabled to
>
>> false, some errors go away and those steps passed. But there are still a
>
>> lot of similar errors. We do like to use the feature of supporting
>
>> JavaScript in the new release. Therefore turning off JavaScript is a
>
>> dumb idea even if it temporarily solve any problem.
>
>> So my question is, what is the proper way to "upgrade" webtest so that
>
>> the old tests will still work with the new build/release? What causes
>
>> the errors? and how to fix/get around them?
>
>> Thanks a lot.
>
>> Tize
>
> _______________________________________________
>
> WebTest mailing list
>
> WebTest@lists.canoo.com
>
> http://lists.canoo.com/mailman/listinfo/webtest
>