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: girishhk <girishhk@?.uk>
  • Date: Thu, 29 Dec 2005 08:55:05 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024;; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5LstIFS+Cu1D3iDk5UkipQcGA2CzZmn86EGiTS9fNtAa17F+e+mIdZ0u9kTgg4WufWBFAwTJI0rYQ4cPPV5Q70c2r8MEhCaYZ6acsUnu7tmMRuVRGWOI3FMW9VxGQ/FG2/ASkvPhEC2LLWb2KaTqiDObzBN9Na3r4Dc9farhLDQ= ;

Hi Greg,
Thank you very much for your input. Let me explain what  I have done and where I am stuck. If you have an idea better than that, plz let me know.
My page has 8 text fields. When page is submitted with data, server side validation will be done and error messages will be displayed on the same page under each text fields if the validation fails.
Implementation using QFtest
I am passing data to these text fields using data driven method. So my data are in csv file. I have written server script to load this csv file, fetch data and fill the fields. This is my first node(server script).
Next node is a procedure call (pagecheckFields) passing the above 8 data as parameters.       pagecheckFields ( 8 parameters)
In procedure pageCheckFields, I am calling the procedure fieldVailadtion 8 times passing each field at a time along with the respective fieldLength and expected error message. Planning to pass field length and expected error message through file. I need your suggestion how to make it. Do I have to store this in a different file or I can use the above file itself? And how to get  this to the variables fieldLength and expErrMag?        fieldVailadtion(3 parameters)
Procedure fieldValidation should have the code for actual validation. I am again stuch here. How to put this in sequence? Depending on the validation result, I should use event textCheck to verify the error message. So I am calling another procedure here called checkText passing the component id of the errormessage and the error message.
Is this approac! h right? If this is the right approach, I need your suggestion where I am stuck.
Thanks in adavnce

Gregor Schmid <Gregor.Schmid@?.de> wrote:

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)

A! hh, 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

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,

girishhk 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
Tulpenstr. 41 Tel: +49 8171 919870
DE-82538 Geretsried Fax: +49 8171 919876

Yahoo! for Good - Make a difference this year.