[Webtest] AW: AW: Always failing when some text is found on page

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Tue, 21 Nov 2006 08:51:56 -0800 (PST)


My idea was something like your second solution. This makes job easer as An=
t
parses and instantiates everything for us. From your propositions, my
favorite would be onEachResponse even if I'm not fully satisfied with it.

An other point to discuss is when these verifications should occur. First
solution would be to perform them after a step has been executed if the
current response has changed. A second solution would be to intercept each
response and to perform the verifications even before the step generating
the page load has been completed. This makes a difference for instance when
using frames, or redirects or some javascript constructs. First solution is
easier to implement and probably easier to understand (the page that gets
verified can be seen in the reports).=20
Would this fit your needs?

Btw. can you open an issue with the information we've already written on th=
e
mailing list?

Marc.


Jochen Zoth wrote:
>=20
> Alright, so let's find a nice name for it :)
>=20
> Do you already have an idea where and how to "setup" this feature?
>=20
> Maybe by defining a file in the config section like:
>=20
> <config
>   host=3D"www.myserver.com"
>   port=3D"8080"
>   protocol=3D"http"
>   basepath=3D"myApp"
>   onEveryResponse=3D"modules/pageValidationSteps.xml" />
>=20
> Or using a new step like
>=20
> <defaultSteps> ... </defaultSteps>
> <baseSteps> ... </baseSteps>
> <responseValidation> ... </responseValidation>
> <onEachResponse> ... </onEachResponse>
>=20
> in each <webtest>?
>=20
> Jochen.
>=20
> -----Urspr=C3=BCngliche Nachricht-----
> Von: webtest-admin@gate2.canoo.com [mailto:webtest-admin@gate2.canoo.com]
> Im Auftrag von Marc Guillemot
> Gesendet: Dienstag, 21. November 2006 10:26
> An: webtest@gate2.canoo.com
> Betreff: Re: [Webtest] AW: Always failing when some text is found on page
>=20
>=20
> In my original post I wrote "the most difficult will be... to find a good
> name for this", now you quote me with "The only difficult Marc has, is to
> find a good name". I now wait for someone to say that's not difficult at
> all
> and should already have been done ;-)
>=20
> Marc.
>=20
>=20
>=20
> Jochen Zoth wrote:
>>=20
>> Hi Alex,
>>=20
>> We had a similar issue few days ago. It was about how to do a set of
>> steps
>> on every page / response you get.
>>=20
>> The only difficult Marc has, is to find a good name ;-)
>>=20
>> " - recurrent check that should occur on each new page. Currently the
>> only
>> way to do that is to included (for instance with an entity) the
>> verification checks each time when a new response is received. This work=
s
>> perfectly and is flexible but it's a bit cumbersome and it's too easy to
>> forget the verification on some pages. Ideally WebTest should provide a
>> way to specify (verification) steps that have to be performed each time =
a
>> new response has been received. I've had this idea on the beginning of
>> the
>> year but WebTest internal didn't provide the possibility to (easily)
>> implement this. Since the refactoring post 2.1 this should now be
>> possible
>> and the most difficult will be... to find a good name for this.
>> Suggestions are welcome. (Marc)"
>>=20
>> Jochen.
>> ________________________________________
>> Von: webtest-admin@gate2.canoo.com [mailto:webtest-admin@gate2.canoo.com=
]
>> Im Auftrag von Curelea, Alexandru
>> Gesendet: Montag, 20. November 2006 23:03
>> An: webtest@gate2.canoo.com
>> Betreff: [Webtest] Always failing when some text is found on page
>>=20
>> Hi all,=20
>> =20
>> I suspect the following isn't possible in Webtest, but I thought I'd ask
>> anyway:
>> =20
>> Is there a way to specify (preferably in a central location like a confi=
g
>> file) some text, such as "Internal server error", which will always caus=
e
>> a page load containing that text to fail?
>> =20
>> My reasoning is the following:
>> =20
>> Since Webtest simulates a user's actions, there are certain errors (such
>> as the above-mentioned "internal server error") that the user should
>> never
>> be able to cause.  If such an error is caused by any of the tests, it
>> should be fixed (eg. it is never "expected behaviour" for the test).=20
>> When
>> the error is given, it might not always be caught by the checks on that
>> page, but it will invariably cause the test to fail later on - it would
>> save a lot of time when reading the test results if it failed right away=
.
>> =20
>> I could, of course, put a VerifyText inside a Not after every page
>> load.... but that isn't really an attractive option, since our test suit=
e
>> numbers in the thousands of steps by now.  This is why I'm hoping for a
>> way to tell Webtest to always fail when it encounters that text, no
>> matter
>> where.
>> =20
>> As I said, I can't really see any way to do this, so I will most likely
>> end up just adding that check in all of our key modules.  But any ideas
>> are very welcome!
>> =20
>> Thanks,
>> =20
>> Alex
>> _______________________________________________
>> WebTest mailing list
>> WebTest@lists.canoo.com
>> http://lists.canoo.com/mailman/listinfo/webtest
>>=20
>>=20
>=20
> --=20
> View this message in context:
> http://www.nabble.com/AW%3A-Always-failing-when-some-text-is-found-on-pag=
e-tf2677663.html#a7468173
> Sent from the WebTest mailing list archive at Nabble.com.
>=20
> _______________________________________________
> 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
>=20

--=20
View this message in context: http://www.nabble.com/AW%3A-AW%3A-Always-fail=
ing-when-some-text-is-found-on-page-tf2679362.html#a7474943
Sent from the WebTest mailing list archive at Nabble.com.