SPONSORS:






User Tag List

Results 1 to 5 of 5

Thread: Dynamic Forms

  1. #1
    Junior Member
    Join Date
    Aug 2000
    Location
    Arlington
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic Forms

    I am testing a website that as hundreds of different request forms. These forms are pretty simple, just a number of textboxes, dropdown menus, check boxes and buttons. I have no problems recording them one at a time, and getting testcases to fill out and submit the forms. But I don't want to have to record every single form, they are all very similar.

    Is there a way to have Silk look at the page, figure out how many textboxes, drop down menus, etc. are on the page and then fill out and sumbit the form accordingly?

    I'm not a programmer, most of my cases are pretty simple - record/playback stuff.

    Any help is appreicated.
    Tim

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

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Location
    Sunyyvale CA USA
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Forms

    As of my knowledge goes Silk can not determine hoe many controls are exisitng on the page for entering data. You need to determine and construct yr testcases to enter data.

    If Silk figure out how many are thre still entering data is a problem. Hope u got the point.

    [This message has been edited by sree (edited 02-07-2001).]
    Sree

  3. #3
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Dynamic Forms

    There is no shortcut to this. You may want to read up on "winclass" topic from the Online Help.
    Even if you are able to come up with just one declaration for the many pages you are talking about, you still need to introduce to SilkTest (via Record/Window Declarations...) the controls that are unique in each page, cut and paste, and throw away the rest.
    If page1 has 5 textfields and page2 has 8 textfields, and you don't care how readable your testscripts, (for shortcut -- not recommended), you can declare and name this controls like TextField1, TextField2, ... all the way to the maximum number of TextFields that you see in a page and just use the Index for the Tags (again not recommended) like tag "#1", tag "#2", etc.
    I keep saying "not recommeded" but, it works and I use this method IF necessary when I see hundreds of "Insert Record" and "Update Record" dialog boxes (same title/caption) that contains similar textfields or drop-down list boxes but, with different labels/captions for each control and each label/caption are invisible to SilkTest (you'll see a lot of these if you are working with Delphi apps).
    So my declaration will look like:

    window DialogBox InsertRecord
    tag "Insert Record"
    TextField TextField1
    tag "#1"
    TextField TextField2
    tag "#2"
    ...
    ...
    TextField TextField18
    tag "#18"

    To make the test case a little bit readable for others, just add // comments to the different TextFields such as:

    w.TextField1.SetText ("ABC") // company name
    w.TextField2.SetText ("91234") // zipcode


    [This message has been edited by Gilbert (edited 02-07-2001).]

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Forms

    You can absolutely determine exactly what controls are on the page and if you're using DOM, you can see tags such as $Name, $Password, $City, $SendNewsletter, $CreditCard, $BirthYear, etc. You need to learn about BrowserPage.GetChildren (), which will return a list of window. You also need to learn about wObject.GetClass (), which will return HtmlTextField, HtmlLink etc. Email me privately and I'll send you the code to do this for a for a simple page.

    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  5. #5
    Junior Member
    Join Date
    Jul 2000
    Location
    Rosemont, IL USA
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic Forms

    ...how about...
    list of window lw = YourPage.GetChildren()
    window w
    for each w in lw
    [+]window wTemp
    [ ]switch(ClassOf(wTemp)
    [+] case HtmlTextField
    [] wTemp.SetText("whatever, or maybe
    [] from file")
    [] break
    [+] case HtmlCheckBox
    [] ...
    [] break
    [+] case...any other case
    [] break
    [+] default
    [] break
    //end for each
    ...now you need to supply the logic of what to input for what gui.
    ...note that with this you don' have to declare any gui or record any form in your frame file. everything will be resolved at runtime.
    john yu




    [This message has been edited by john yu (edited 02-09-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 07:21 PM.

Copyright BetaSoft Inc.