SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    declaring controls on dynamic pages

    I'm not exactly sure where this should be posted...I'm using Silktest, but this question is more of an automation design issue.

    Within our web product, we have pages which are dynamically created. For instance, if on page 1 the user defines 3 attributes, on page 2 they will be presented with 3 attribute rows of contols (with checkboxes, textfields, etc.). I declare this 2nd window and all is good.

    However, what if, during testing, the user defines 4 (or more) attributes on page 1? On page 2 there will be 4 (or more) attribute rows of controls. Since the 2nd page was originally declared with only 3 rows, Silktest will not be able to click on any of the 4th row controls.

    I see my options as:
    1) Prior to creating ANY automated scripts, I must define EXACTLY what data will be in the system (# of attributes, etc.). Then, during scripting, I will know exactly what controls to expect on each page.

    2) Find some tricky way to click on ANY control on ANY page regardless of if it is declared or not.

    I've already written several extended methods for finding and clicking on dynamic HtmlLinks. Would option 2 be similarly done?

    Which option is the better route?

    Thanks...

    -Damian Synadinos

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    New York, NY, USA
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: declaring controls on dynamic pages

    I would use method 1 if there will not be too many new controls. What I do is just manualy add the objects to the include file file and then record or script what I want the testcase to do. Silk doesn't care if declared objects are on the page or not unless you try to use them in some way.

    Example:

    Code:

    HtmlTextField txtLineOneNumOne
    tag "#1"
    HtmlTextField txtLineOneNumTwo
    tag "#2"
    HtmlTextField txtLineOneNumThree
    tag "#3"
    HtmlTextField txtLineTwoNumOne
    tag "#4"
    HtmlTextField txtLineTwoNumTwo
    tag "#5"
    HtmlTextField txtLineTwoNumThree
    tag "#6"
    HtmlTextField txtLineThreeNumOne
    tag "#7"
    HtmlTextField txtLineThreeNumTwo
    tag "#8"
    HtmlTextField txtLineThreeNumTrhee
    tag "#9"
    HtmlTextField txtLineFourNumOne
    tag "#10"
    HtmlTextField txtLineFourNumTwo
    tag "#11"
    HtmlTextField txtLineFourNumThree
    tag "#12"

    End Code:

  3. #3
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: declaring controls on dynamic pages

    As another approach you can also use dynamic instantiated tags to reference objects. For example if you know, based on a user selection on Page1, that Page2 will contain four HtmlTextFields and four HtmlPushButtons you could then interact with those objects using the following object references in your testcase:

    Page2.HtmlTextField("#2").SetText("blah")

    or

    Page2.HtmlPushButton("#1").Click ()


    Another alternative would be to dynamically "discover" the objects on Page2--assuming you can make sense out of their functionality based on index order. For example:

    window wButton

    wButton = Page2.HtmlPushButton("#1")

    if (wButton.Exists() {
    // do some work...
    }


    -fyi, Terry Horwath


  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: declaring controls on dynamic pages

    Thanks to both of you for your ideas!

    Woodman,

    I think I understand what you're getting at. Declare "more than enough" contols on each dynamimc page. If I need to interact with a control on a page, it will already be declared. However, what about stress testing? If I declare 10 attributes on page 1 (which SHOULD be enough), the second page will have 10 rows of controls. What if I'm asked to add 100 attributes on page 1 and then interact with each control on page 2?

    Terry,

    Your first suggestion may work. I'll have to research it a little more.

    I'm not sure I fully understand your second suggestion.

    I've written several functions (see below)that will search for any undefined controls (controls not in any .inc file) on a page, parse the control string(s), and log it to an include file (looks exactly the same as if you did a Record > Window Declarations). Great! But what do I do with it?

    Actually, The more I think about it, the less of a problem it is. If the data set is pre-determined and the testcases are designed and written correctly, there should never be ANY occasion where a page contains "unexpected" data or controls!

    UndefinedControls - finds all controls not defined in any include files

    LogUndefinedToIncludeFile - writes each control as a Window Identifier and Tag to a specified include file

    MakeWindowIdentifier - formats control dynamic instantiaion using:

    UpperCase - converts first character of every word (in a string) to upper case

    and

    RemovePunctuation - removes puntuation from a string


    [This message has been edited by Damian Synadinos (edited 09-29-2000).]

  5. #5
    Junior Member
    Join Date
    Feb 2002
    Location
    SF,CA 94116
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: declaring controls on dynamic pages

    I think I have an i idea what are you trying to do, can i see your LogLineToFile func.



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

 

 

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 05:36 AM.

Copyright BetaSoft Inc.