[Webtest] Loops Data Driven Testing, Load Data from a plain text file.

Racic Michel (KSPF 821) Racic Michel (KSPF 821)" <michel.racic@credit-suisse.com
Fri, 8 Apr 2011 11:52:25 +0200


Hi

As he is asking about plaintext files...
Here's an example to read from a csv:

<groovy description=3D"csv test" >=20
        new File("tests/test.csv").splitEachLine(",") {fields ->=20
                step.setWebtestProperty('field1', fields[0])=20
        }=20
</groovy>=20
<echo message=3D"test #{field1}" />=20

Put this in a loop and adapt it to your format.
Othjerwise if you first convert your plaintext inputfile to an excel you =
can use the datadriven step.

Best regards

Michel

-----Original Message-----
From: webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Murat
Sent: Friday, April 08, 2011 9:06 AM
To: webtest@lists.canoo.com; Habbert, Michael (Key-Work)
Subject: Re: [Webtest] Loops Data Driven Testing, Load Data from a plain =
text file.

Hi,

I think the step is called dataDriven. :)

http://webtest.canoo.com/webtest/manual/dataDriven.html

Regards,
Murat



2011/4/8 Habbert, Michael (Key-Work) <michael.habbert@key-work.de>:
> Hi Vu Quach,
>
>
>
> you can program something like a loop by using:
>
>
>
> http://webtest.canoo.com/webtest/manual/repeat.html
>
>
>
> and I think I read some notes about reading test-data from an =
Excel-File to
> use them inside a test.
>
>
>
> Greetings
>
>
>
> Michael Habbert
>
>
>
>
>
> Michael Habbert
> Key-Work Consulting GmbH | Kriegsstr. 100 | 76133 Karlsruhe | Germany =
|
> www.key-work.de
> Fon: +49-721-78203-269 | E-Mail: michael.habbert@key-work.de | Fax:
> +49-721-78203-10
>
> Key-Work Consulting GmbH, Karlsruhe, HRB 108695, HRG Mannheim
> Gesch=E4ftsf=FChrer: Andreas Stappert, Tobin Wotring
>
> Von: webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com] Im
> Auftrag von Vu Quach
> Gesendet: Freitag, 8. April 2011 04:55
> An: WebTest@gate4.canoo.com
> Betreff: [Webtest] Loops Data Driven Testing, Load Data from a plain =
text
> file.
>
>
>
> hi there,
> i`m a newbie to Canoo.
> - I wonder if there are some way to make Loops Data Driven through out =
the
> test?
> -=A0 Can Canoo Webtest load data from a plain text file in to the =
TestCase?
>
> --
> Best Regards,
> Vu Quach
> Java Developer
> AXON ACTIVE VIETNAM
> www.axonactive.vn
> 10th Floor, Hai Au Building, 39B Truong Son, Ward 4, Tan Binh =
District, Ho
> Chi Minh City, Vietnam
> Telephone: +84 8 629 738 59,
> Fax: +84 8 381 134 89,
> Mobile: +84908 01 00 84
> 106=B039'51"East / 10=B048'32"North
> Email: vu.quach@axonactive.vn/nomatterhow21@yahoo.com
_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest