6 messages in com.canoo.lists.webtestRE: [Webtest] design
FromSent OnAttachments
Brandon Moore30 Jun 2003 12:54 
Graham Cunningham30 Jun 2003 13:30 
Brandon Moore30 Jun 2003 13:46 
Graham Cunningham01 Jul 2003 13:37 
Brandon Moore02 Jul 2003 08:03 
Dierk Koenig02 Jul 2003 08:51 
Subject:RE: [Webtest] design
From:Graham Cunningham (grah@itwks.com)
Date:07/01/2003 01:37:20 PM
List:com.canoo.lists.webtest

And the short answer is nope, don't know why it does it this way. 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

-----Original Message----- From: webt@gate.canoo.com [mailto:webt@gate.canoo.com] On Behalf Of Brandon Moore Sent: Montag, 30. Juni 2003 22:47 To: webt@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?

-----Original Message----- From: webt@lists.canoo.com [mailto:webt@lists.canoo.com]On Behalf Of Graham Cunningham Sent: Monday, June 30, 2003 3:31 PM To: webt@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: webt@gate.canoo.com [mailto:webt@gate.canoo.com] On Behalf Of Brandon Moore Sent: Montag, 30. Juni 2003 21:55 To: webt@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?

-----Original Message----- From: webt@lists.canoo.com [mailto:webt@lists.canoo.com]On Behalf Of Aatish Arora Sent: Monday, June 30, 2003 1:40 PM To: webt@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" <heta@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:bmo@commcode.com] Sent: Monday, June 30, 2003 9:05 AM To: webt@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: webt@lists.canoo.com [mailto:webt@lists.canoo.com]On Behalf Of Thakkar, Hetal Sent: Friday, June 27, 2003 6:54 PM To: webt@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=left>&nbsp;</td> <td width="90%" align=right> <a class=cmd href='' LANGUAGE="javascript" onclick="SubmitWithDisclosure('Update',

'http://alert10.alert2000.cdcla.com/portalsim/gecdredirection.asp');

return false"> <img src="images/btnLeft.gif" border=0 align=top> &nbsp;Submit&nbsp; <img src="images/btnRight.gif" border=0 align=top> </a> &nbsp; </td> </tr>

From the discussion board, I found a post that suggested to do the following, I also tried it with label="Submit": <clicklink label="" href="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

b2Um7,6X,6G