SPONSORS:






User Tag List

Results 1 to 3 of 3

Thread: Alphanumeric?

  1. #1
    syi
    syi is offline
    Junior Member
    Join Date
    Aug 2001
    Location
    Fairfax, VA, USA
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Alphanumeric?

    I recently began learning SilkTest and I am in need of some help... I need to create testcases that verify that certain fields are alphanumeric, just numeric, or just alpha. Also I need to test that some fields have specific length of characters. I vaugely remember something about alphanumeric fields from training but haven't had any luck finding more information on it...

    Any input is greatly appreciated!!!

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Alphanumeric?

    You're going to have to script this. Essentially, to confirm that a field only accepts alpha characters (i.e.- a-Z), use SetText ("1234567890") and then verify that GetText returns an empty string.

    As for verifying capacity.... If the capacity of the TextField object is supposed to be, for example, 20 characters, put 21 characters into the field and then verify that GetText is 20.

    For example...

    You could also modify the TextField class to have methods to do all of this for you. Hmmm...maybe I'll do that today.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com

    [This message has been edited by dcreed (edited 08-14-2001).]
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Alphanumeric?

    OK, you should probably be able to manage that. Assuming that a textfield being numeric (to take one example) means that certain characters (anything except the digits 0-9) should be rejected; the mechanism of this can vary, but commonly it is implemented as other characters typed into the textfield are not displayed, and a beep is sounded.
    With a judicious combination of TypeKeys (to get exact control over what you're doing) and GetText (to find out what it's displaying), you should be able to confirm that disallowed characters are being correctly rejected by your textfield.

    I suspect that the best way of doing this would be to implement a method or a group of related methods in the TextField class (see Extending The Class Hierarchy in the manual for details of how to do this), which will make the writing of multiple testcases of this kind (on different textfields in your aut) fairly straightforward.

    I hope I've made myself clear; I don't know how to go into further detail without more information about how your developers intend to implement a textfield being alphabetic/alphanumeric/etc.

    One possible problem I can see with this approach is if you run into the problem referred to in http://www.qaforums.com/Forum1/HTML/002227.html where even though your aut's field is not displaying an invalid character in the textfield, silktest still sees it. In that case, some experimentation with the different methods available to you (e.g. GetProperty, VerifyValue, GetContents) to see what works in your situation.

    ------------------


    [This message has been edited by vincebowdren (edited 08-14-2001).]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:59 AM.

Copyright BetaSoft Inc.