[Webtest] Member Poll: javascript solution for WebTest
webtest@lists.canoo.com
webtest@lists.canoo.com
Thu, 15 Aug 2002 17:15:37 -0500
I apologize for not getting back to you sooner on this issue;
This is really something we could use!! :- )
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.
Here are some exerpts from our html files:
a)=20
<FORM ACTION=3D"test.crm;jsessionid=3DC584934B397086FAEB5E35A7FE522490"
METHOD=3D"post" ONSUBMIT=3D"JavaScript:jsSetFormParameters(0, =
'finish');"
ONRESET=3D"JavaScript:jsExecute(0, 'cancel');">
b) This code is used to select a row in a table
and pass the index of the selected row to the
server.
<tr onMouseDown=3D"jsHandleTableMouseDown();"
id=3D"CustomerRow"
onClick=3D"jsSelectCustomer(0);"
onDblClick=3D"JavaScript:jsExecute(0, =
'select?id=3D0');"
border=3D"1"
class=3D"gridEvenRow"
>
2) Field validation -- check for the
user's input and validate it BEFORE they
click the submit button.
Don't have have any specific examples. Stay tuned.=09
=20
#############################################################
J a v a S c r i p t
#############################################################
function jsSetFormParameters( thisComponentId, 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 "";
}
}
}
}
function jsExecute( thisComponentId, thisActivationKey )
{
with ( document.forms[0] )
{
jsSetFormParameters(thisComponentId, thisActivationKey);
submit();
}
}
> -----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 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