Mailingliste - Einträge 2005


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] How to write procedures for common functionalities


  • Subject: Re: [qftestJUI] How to write procedures for common functionalities
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 29 Dec 2005 09:21:55 +0100

Hi Giri,

interesting question. Though the task itself is reltively easy to
handle, you have to piece a few things together to do it correctly:

Create a procedure checkLength with parameters id (of component) and
length (and maybe client, see the qfs.qft standard library provided by
with qftestJUI).

As first node, add the following server script:

good = 'A' * $(length)  # Create a string of length times A
bad = good + 'B'        # append one B
rc.setLocal("good", good)
rc.setLocal("bad", bad)

Ahh, the power of Jython... :-)

You now have two strings defined, one that should just work and one
that just shouldn't. Next node, add a Text input with "Component id"
$(id), text $(good) and select "Clear first" and "Replay single
events". The latter is essential, otherwise the length check of the
field cannot work.

Follow that with a "Check text" for Component $(id), expected value
$(good).

Copy the "Text input" and "Check text" node, and change the text
attribute of the input from $(good) to $(bad). Keep the check's
expected value $(good). If your text field silently ignores the
extraneous input you should be done. If you get an error message
instead, remove the last check and replace it with a check for and
closing of the error message.

Best regards,
    Greg

girishhk <girishhk@?.uk> writes:

> Hi,
>
> I have a scenario where in a java page has few text
> fields and need to be done validation for those fileds
> for their maximum length input. My plan is to write
> procedure, pass the textfields, their max length and
> the expected result as parameters to this procedure.
> How can I do this in QFTest? Any idea/suggestions/help
> are greately appriciated.
>
> Thanks
> Giri

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen