SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Dec 2006
    Location
    Harleysville, PA
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Data-driven scripts across multiple screens?

    I have a web application where the data I'm inputting into the forms lies in several tables in the DB and gets inputted across many different screens. I'm trying to architect the best (and fastest) way of reading in the data from a SQL database. Right now, the relationship is 1:1 (one table for one screen), though that is subject to change. I'm thinking something along the lines of putting the database calls in a module and variablizing it, but I want to make the least number of database calls as possible. I'm unclear on how I get the field values from the module back to the calling script if I do that, however. Can anyone help?

  2. #2
    Senior Member
    Join Date
    Sep 2004
    Location
    Toronto, Canada
    Posts
    555
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Data-driven scripts across multiple screens?

    If you create a shared module and have public variables in it, those public variables will be visible in any script you write.

    Or, If you create a module and have public variables in it, those public variables will be visible in any script in which you include the module.

    Or, if you create a class module and have public variables in it, those public variables will be visible in any script that includes the class and declares a variable to use it.

    Aracknid.
    TestPartner:
    Current AUT running test scripts on TP 6.3 build 183, SQL 2000 DB.
    Legacy AUT running on TP 5.6.0 Build 81 and TP 6.2 build 449 with SQL 2000 DB.

    Test Environment:
    TP/IE Clients on VMWare ESX 4.1 server, AUT Servers on VMWare ESX 3.5 server.

    Application Under Test (AUT):
    Client/Server based, IE 7/8 interface with SQL 2005/2008 DB.

    Automating with TP since August 2004.

  3. #3
    Member
    Join Date
    Dec 2006
    Location
    Harleysville, PA
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Data-driven scripts across multiple screens?

    Oh, ok. Historically, I'm a record and playback kinda guy, so I'm still grasping the public and private declarations thing here.

    The only other question is how would you architect it? Is making a database call for every field name on every page really the best way to go (ie: just variablize the inputs to the subroutine for the select statement)? Or, would it be better to minimize the calls by scripting one call per a page and sending back all the values for that page's table?

    On the other hand, the variablizing of the select statement, while having more overhead, would make it reusable across projects and easier to maintain when changes occur.

    Thanx.

  4. #4
    Senior Member
    Join Date
    Apr 2005
    Location
    Manchester
    Posts
    255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Data-driven scripts across multiple screens?

    I would read in all the db data at the start of the script run. I'd declare a separate array for each db table and give each array a meaningful name that refers to the screen it relates to. I think this is a simpler approach than having a select statement inside a parametised routine. I'd put the arrays inside a shared module so that they are publically available to all the scripts.

    I think this is better than making a db call on an "as needed" basis because that approach has the extra overhead of repeatedly setting up and close down connections, but more importantly carries the risk of the data suddenly becoming unavailable in the middle of a script run, e.g. the db is on a server and the server goes down.
    Rob

  5. #5
    Member
    Join Date
    Dec 2006
    Location
    Harleysville, PA
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Data-driven scripts across multiple screens?

    Rob, I like that idea! Thanx!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 12:10 AM.

Copyright BetaSoft Inc.