[Webtest] Member Poll: javascript solution for WebTest
webtest@lists.canoo.com
webtest@lists.canoo.com
Tue, 20 Aug 2002 11:17:51 -0500
In the short term, I need to add some very limited, temporary support
the javascript patterns in the forwarded email.
I want to run my design ideas against you all.
I'm not that familiar with the code, so I'm hoping
you can tell me precisely how crazy my ideas are.
Chime in if this kind of support will benefit the community
and I'll post my changes. I've seen patterns like this
with three different JSP frameworks. Have you all seen it elsewhere?
-------------------- Case 1 -----------------------
Java script that sets hidden fields prior to submit
---------------------------------------------------
For javascript that resides in the <FORM> tag (as shown below)
I'll have to modify the ClickButton task.
If the ClickButton is the submit button, then I'll have to
a) Retrieve the javascript from the Form element.
b) If I find our standard js hidden field 'setter' function
(jsSetFormParameters)
c) then I'll set hidden fields by dynamically creating and
dynamically adding one 'setinputfield' task for each of our
special hidden fields.
-------------------- Case 2 ---------------------------------
'Selecting' a row in a table / submit form based on selection
-------------------------------------------------------------
a) I'll add a new task -- perhaps something like 'RowSelection'
b) It will contain a required, nested 'index locator'. I considered
a table locator instead, but the table locator's column attribute is
required.
When selecting a row, we don't care about the column.
c) Retrieve the java script from the <tr> element, onDblClick attribute
(as shown below).
d) proceed with step b) for Case 1.
> -----Original Message-----
> From: Ostermueller, Erik=20
> Sent: Thursday, August 15, 2002 5:16 PM
> To: webtest@lists.canoo.com
> Subject: RE: [Webtest] Member Poll: javascript solution=20
> for WebTest
>=20
>=20
> I apologize for not getting back to you sooner on this issue;
> This is really something we could use!! :- )
>=20
>=20
> Here are a few things we need out of JavaScript:
> 1) Form submission. =20
> We use hidden fields to help maintain state.
> When you want to submit a form, you call a our own jsExecute()
> It will set certain hidden fields before the POST.
>=20
> Here are some exerpts from our html files:
> a)=20
> <FORM=20
> =
ACTION=3D"test.crm;jsessionid=3DC584934B397086FAEB5E35A7FE522490"
> METHOD=3D"post"=20
> ONSUBMIT=3D"JavaScript:jsSetFormParameters(0, 'finish');"
> ONRESET=3D"JavaScript:jsExecute(0, 'cancel');">
>=20
> b) This code is used to select a row in a table
> and pass the index of the=20
> selected row to the
> server.
>=20
>=20
> <tr onMouseDown=3D"jsHandleTableMouseDown();"
> id=3D"CustomerRow"
> onClick=3D"jsSelectCustomer(0);"
> onDblClick=3D"JavaScript:jsExecute(0,=20
> 'select?id=3D0');"
> border=3D"1"
> class=3D"gridEvenRow"
>=20
> >
> 2) Field validation -- check for the
> user's input and validate it BEFORE they
> click the submit button.
>=20
> Don't have have any specific examples. Stay tuned.=09
>=20
> =20
> #############################################################
> J a v a S c r i p t
> #############################################################
> function jsSetFormParameters( thisComponentId,=20
> thisActivationKey)=20
> {
> with ( document.forms[0] )
> {
> toComponentId.value =3D thisComponentId;
> activationKey.value =3D thisActivationKey;
> scrollLeft.value =3D document.body.scrollLeft;
> scrollTop.value =3D document.body.scrollTop;
> =20
> if ( window !=3D null )
> {
> if ( window.event !=3D null )
> {
> controlFocus.value =3D window.event.srcElement.name;
> }
> else
> {
> controlFocus.value =3D "";
> }
> }
>=20
> }
>=20
> }
>=20
> function jsExecute( thisComponentId, thisActivationKey )
> {
> with ( document.forms[0] )
> {
> jsSetFormParameters(thisComponentId,=20
> thisActivationKey);
> submit();
> }
>=20
> }
>=20
>=20
>=20
>=20
>=20
>=20
> > -----Original Message-----
> > From: Ostermueller, Erik=20
> > Sent: Monday, July 15, 2002 2:42 PM
> > To: webtest@lists.canoo.com
> > Subject: RE: [Webtest] Member Poll: javascript solution=20
> > for WebTest
> >=20
> >=20
> > This page=20
http://htmlunit.sourceforge.net/generaldoc11.html
> documents some JavaScript support for a web testing framework=20
> called HtmlUnit (not to be confused with 'HttpUnit').
>=20
> -----Original Message-----
> From: Ostermueller, Erik=20
> Sent: Monday, July 15, 2002 2:08 PM
> To: webtest@lists.canoo.com
> Subject: RE: [Webtest] Member Poll: javascript solution=20
> for WebTest
>=20
>=20
> I'm working on getting some stories together.
> It may take me a few days to get ahold of the right people.
> Thanks for asking!
>=20
> -----Original Message-----
> From: Dierk K=F6nig [mailto:Dierk.Koenig@canoo.com]
> Sent: Friday, July 12, 2002 3:41 AM
> To: webtest@lists.canoo.com
> Subject: [Webtest] Member Poll: javascript solution for WebTest
>=20
>=20
> Hiall,
>=20
> for the next activities concerning JavaScript support=20
> for WebTest
> I would like you to send your JS "stories" to this list.
>=20
> What JS do you use in your webapp that you would like to test
> with WebTest?
>=20
> We would appreciate if you could send your JS code under test
> with your story.
>=20
> The more you send, the better we can serve you.
>=20
> Thanx in advance for your contribution.
> Mittie
> _______________________________________________
> 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
>=20
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest