[Webtest] design

Graham Cunningham webtest@lists.canoo.com
Tue, 1 Jul 2003 22:37:42 +0200


And the short answer is nope, don't know why it does it this way.=20
Might give this change a go though as it could solve an issue that I
have that my webtest parameters aren't passed on when I use a link which
does a submit
Cheers
Graham

Graham Cunningham
IT Works Consulting
http://itwks.com
Natel : +41 79 233 3772=20


-----Original Message-----
From: webtest-admin@gate.canoo.com [mailto:webtest-admin@gate.canoo.com]
On Behalf Of Brandon Moore
Sent: Montag, 30. Juni 2003 22:47
To: webtest@gate.canoo.com
Subject: RE: [Webtest] design

Thanks.

As far as I can tell, the paramater map is only used in clickbutton.
invokepage resets it. There is a HashMap holding parameter/value
pairs which are set on the same form as the button and an array of
names of parameters to be cleared. This is the same parameter map
you are talking about, right? HttpUnit maintains it's own state
information for the form right in the WebForm object, which is
accessible to scripts (webtest sets the form from the parameter
map before httpunit executes the onclick handler, so everything
works out there). HttpUnit handles javascript that manipulates
field values correctly, as far as I can tell. Do you know why
webtest maintains this parallel state information rather than
setting (and resetting) fields in HttpUnit?

Brandon

-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Graham Cunningham
Sent: Monday, June 30, 2003 3:31 PM
To: webtest@gate.canoo.com
Subject: RE: [Webtest] design


Hi there,
Like you I am only a beginner with the internals, however when I looked
into this it appeared that the parameter map normally gets added to an
httpunit request, if javascript is invoked however control never passes
back to webtest and the request is executed directly so there is no
chance of the parameters being added to the request. This is also a
reason why javascript that manipulates field values would also be
ignored by webtest (well httpunit really).

Regards
Graham



-----Original Message-----
From: webtest-admin@gate.canoo.com [mailto:webtest-admin@gate.canoo.com]
On Behalf Of Brandon Moore
Sent: Montag, 30. Juni 2003 21:55
To: webtest@gate.canoo.com
Subject: [Webtest] design

I've been looking through the canoo internals trying to
solve a problem I've had with javascript, and I'm wondering
what the parameters accumlated in the context are for. They
seem to be used in clickbutton to set the form elements, but
why doesn't the code set the parameters directly on the
WebForm? This also seems likely to break javascript code that
expects to manipulate form values (the form is populated from
the map in clickbutton, so things work there, but if you were
trying to test an onmouseover handler or something you might
have problems). Is there any good reason for doing things this
way?

Brandon

-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Aatish Arora
Sent: Monday, June 30, 2003 1:40 PM
To: webtest@lists.canoo.com
Subject: RE: [Webtest] How to invoke Javascript from canoo?


I dont think Canoo supports Unicode entirely  - ive
had pelnty of problems during a trial run. I tried it
out with some Hebrew stuff - but it just refused to
work. If there is a way do let me know too!

Cheers!
Aatish

--- "Thakkar, Hetal" <hetal.thakkar@citigroup.com>
wrote:
> Hi Brandon,
>
> When I use "" as label of link then the test runs
> without any error, but this function
> "SubmitWithDisclosure" is supposed to update a
> database, which is not being done, so I don't think
> it is invoked.
> When I use "Submit" or " Submit " as label of the
> link then I get link not found error.
> The xpath returns "\u00A0Submit\u00A0", which is
> unicode for "C!SubmitC!", I tried using that and I
> get the same link not found error with text
> "CSubmitC". I think the problem here is that for
> some reason when I put "C!" in my tests it is
> changed to "C" when comparing, so it does not work.
>
> Thanks for your reply,
> Hetal
>
>
> -----Original Message-----
> From: Brandon Moore [mailto:bmoore@commcode.com]
> Sent: Monday, June 30, 2003 9:05 AM
> To: webtest@gate.canoo.com
> Subject: RE: [Webtest] How to invoke Javascript from
> canoo?
>
>
> Looking through the code, I think canoo misses the
> onclick handler.
> (Canoo uses WebLink.getRequest(), rather then
> WebLink.click()).
> HttpUnit (or at least jWebUnit) seems to handle
> onclick and
> a "u"ri of the form javascript:stuff(). I'm going to
> try changing
> canoo to use WebLink.click() rather than pulling the
> URL off
> WebLink.getRequest().
>
> What exactly do you mean by "Doesn't work"? If canoo
> isn't finding
> the link I would try the exact text as reported by
> XPath explorer
> (probably " Submit "). Is the javascript failing? If
> you are
> getting a NoClassDefFound (maybe for
> Javascript$Form?) it's probably
> a bug I've been seeing.
>
> Brandon
>
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of
> Thakkar, Hetal
> Sent: Friday, June 27, 2003 6:54 PM
> To: webtest@gate.canoo.com
> Subject: [Webtest] How to invoke Javascript from
> canoo?
>
>
> Hi all,
>
> I have the followig html code and I want to invoke
> the javascript
> function invoked by "OnClick".
>
> <tr>
>     <td nowrap align=3Dleft>&nbsp;</td>
>     <td width=3D"90%" align=3Dright>
>         <a class=3Dcmd href=3D'' LANGUAGE=3D"javascript"
> onclick=3D"SubmitWithDisclosure('Update',
>
'http://alert10.alert2000.cdcla.com/portalsim/gecdredirection.asp');
> return false">
>             <img src=3D"images/btnLeft.gif" border=3D0
> align=3Dtop>
>             &nbsp;Submit&nbsp;
>             <img src=3D"images/btnRight.gif" border=3D0
> align=3Dtop>
>         </a>
>         &nbsp;
>      </td>
>  </tr>
>
> From the discussion board, I found a post that
> suggested to do the
> following, I also tried it with label=3D"Submit":
> <clicklink label=3D""
> href=3D"javascript:SubmitWithDisclosure('Update',
>
'http://alert10.alert2000.cdcla.com/portalsim/gecdredirection.asp');
> return false;"/>
>
> But this does not work, does anyone have any other
> ideas?
>
> Thanks,
> Hetal
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> YfSzKfj)b=1E
b2U=1Em7,6X,6G

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest