[Webtest] newbies question-how can I implement this

Dierk Koenig webtest@lists.canoo.com
Wed, 27 Aug 2003 13:20:44 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C36C9E.05A3CF80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

attached is a file sleep.java that implements the sleep custom step.

add the sleep.class to your webtest.jar (it needs to be in the
subdir com\canoo\webtest\extension of the jar).

add the following line to your webtesttaskdefs.properties:
sleep=com.canoo.webtest.extension.Sleep

now you have a sleep step like below that you can use like any other
step.

cheers
Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of linux guy
> Sent: Montag, 25. August 2003 5:44
> To: webtest@lists.canoo.com
> Subject: RE: [Webtest] newbies question-how can I implement this
>
>
> thank u a lot.
> I just write code as below:
> <myCustomStep>
> <sleep msecs="1000"/>
> </myCustomStep>
> but ant tells me that myCustomStep doesn't support element sleep
>
> could u give me one simple but complete sample which implements sleep?
> thx u a lot!
> ----- Original Message -----
> From: "Dierk Koenig" <dierk.koenig@canoo.com>
> Date: Fri, 22 Aug 2003 11:40:28 +0200
> To: <webtest@lists.canoo.com>
> Subject: RE: [Webtest] newbies question-how can I implement this
>
> > you best look into
> >
> http://webtest.canoo.com/webtest/api/com/canoo/webtest/extension/M
> yCustomSte
> > p.html
> >
> > make a step that can be used as <sleep msecs="1000"/> .
> > Hint: your doExecute Method will be something like
> > 	Thread.currentThread().sleep(fMsecs);
> >
> > cheers
> > Mittie
> >
> > > -----Original Message-----
> > > From: webtest-admin@lists.canoo.com
> > > [mailto:webtest-admin@lists.canoo.com]On Behalf Of linux guy
> > > Sent: Freitag, 22. August 2003 11:00
> > > To: webtest@lists.canoo.com
> > > Subject: RE: [Webtest] newbies question-how can I implement this
> > >
> > >
> > > thx a lot
> > > I write one Customstep ,that is one <invoke> followed by several
> > > <verifytitle>
> > > but it doesn't work yet.
> > > could u give me some advice or a piece of example?
> > > thx
> > > ----- Original Message -----
> > > From: "Dierk Koenig" <dierk.koenig@canoo.com>
> > > Date: Fri, 22 Aug 2003 10:30:17 +0200
> > > To: <webtest@lists.canoo.com>
> > > Subject: RE: [Webtest] newbies question-how can I implement this
> > >
> > > > Hi,
> > > >
> > > > there is no such "sleep" step but you can easily create a CustomStep
> > > > for doing so. Refer to the online doc for more information.
> > > >
> > > > What feature of your application are your going to test
> > > > with such a high repeat count?
> > > >
> > > > curious
> > > > Mittie
> > > >
> > > > > -----Original Message-----
> > > > > From: webtest-admin@lists.canoo.com
> > > > > [mailto:webtest-admin@lists.canoo.com]On Behalf Of linux guy
> > > > > Sent: Freitag, 22. August 2003 9:14
> > > > > To: webtest@lists.canoo.com
> > > > > Subject: [Webtest] newbies question-how can I implement this
> > > > >
> > > > >
> > > > > hi,I install ant now,and can make it works well
> > > > >
> > > > > I use <repeat count="X"> to visit one html page
> > > > > to test our web server,when X is not big enought,such as(1-300),
> > > > > it works well,but when I set X to 800 or some number else,
> > > > > ant give me the exception "connection time out".
> > > > >
> > > > > so I wanna set when one step is finished,the process can pause
> > > > > for some time,
> > > > > I think there may be some Specification which is similar with
> > > sleep in C,
> > > > > but I can't find it?
> > > > >
> > > > > how can I do?thx
> > > > >
> > > > > --
> > > > > ______________________________________________
> > > > > http://www.linuxmail.org/
> > > > > Now with e-mail forwarding for only US$5.95/yr
> > > > >
> > > > > Powered by Outblaze
> > > > > _______________________________________________
> > > > > 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
> > >
> > > --
> > > ______________________________________________
> > > http://www.linuxmail.org/
> > > Now with e-mail forwarding for only US$5.95/yr
> > >
> > > Powered by Outblaze
> > > _______________________________________________
> > > 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
>
> --
> ______________________________________________
> http://www.linuxmail.org/
> Now with e-mail forwarding for only US$5.95/yr
>
> Powered by Outblaze
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
>

------=_NextPart_000_0005_01C36C9E.05A3CF80
Content-Type: application/octet-stream;
	name="Sleep.class"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="Sleep.class"

yv66vgAAAC4ASQoAEQAqCQAQACsHACwIAC0KAAMALgoALwAwCgARADEIADIHADMKAAkAKggANAoA
CQA1CgAJADYKAAkANwsAOAA5BwA6BwA7AQAGZk1zZWNzAQABSQEABjxpbml0PgEAAygpVgEABENv
ZGUBAA9MaW5lTnVtYmVyVGFibGUBABJMb2NhbFZhcmlhYmxlVGFibGUBAAR0aGlzAQAjTGNvbS9j
YW5vby93ZWJ0ZXN0L2V4dGVuc2lvbi9TbGVlcDsBAAlkb0V4ZWN1dGUBACUoTGNvbS9jYW5vby93
ZWJ0ZXN0L2VuZ2luZS9Db250ZXh0OylWAQAHY29udGV4dAEAIkxjb20vY2Fub28vd2VidGVzdC9l
bmdpbmUvQ29udGV4dDsBAApFeGNlcHRpb25zBwA8AQAIc2V0TXNlY3MBAAQoSSlWAQAMbWlsbGlz
ZWNvbmRzAQAWZ2V0UGFyYW1ldGVyRGljdGlvbmFyeQEAESgpTGphdmEvdXRpbC9NYXA7AQADbWFw
AQAPTGphdmEvdXRpbC9NYXA7AQAKU291cmNlRmlsZQEAClNsZWVwLmphdmEMABQAFQwAEgATAQAv
Y29tL2Nhbm9vL3dlYnRlc3QvZW5naW5lL1N0ZXBFeGVjdXRpb25FeGNlcHRpb24BACFSZXF1aXJl
ZCBwYXJhbWV0ZXIgbXNlY3Mgbm90IHNldCEMABQAPQcAPgwAPwBADAAkACUBAAVNc2VjcwEAFm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------=_NextPart_000_0005_01C36C9E.05A3CF80
Content-Type: application/octet-stream;
	name="Sleep.java"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Sleep.java"

package com.canoo.webtest.extension;=0A=
=0A=
import com.canoo.webtest.engine.Context;=0A=
import com.canoo.webtest.engine.StepExecutionException;=0A=
import com.canoo.webtest.steps.Step;=0A=
=0A=
import java.util.Map;=0A=
=0A=
public class Sleep extends Step=0A=
{=0A=
	private int fMsecs =3D -1;=0A=
=0A=
	public void doExecute(Context context) throws InterruptedException=0A=
	{=0A=
		if (fMsecs =3D=3D -1)=0A=
			throw new StepExecutionException("Required parameter msecs not set!");=0A=
		Thread.sleep(fMsecs);=0A=
	}=0A=
=0A=
	public void setMsecs(int milliseconds)=0A=
	{=0A=
		fMsecs =3D milliseconds;=0A=
	}=0A=
=0A=
	public Map getParameterDictionary()=0A=
	{=0A=
		Map map =3D super.getParameterDictionary();               // general =
attributes (stepId)=0A=
		map.put("Msecs", ""+fMsecs);     // cannot be null (mandatory)=0A=
		return map;=0A=
	}=0A=
=0A=
}=0A=

------=_NextPart_000_0005_01C36C9E.05A3CF80--