SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Aug 2001
    Location
    Manchester, NH
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Where are people adding new methods?

    It seems like there are number of options when adding new methods to classes. I was wondering what the different approaches are. The two most obvious to me seem to be to add methods directly to winclass.inc or to extend classes in your own include file and add them there.

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

  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: Where are people adding new methods?

    The problem with modifying winclass.inc is that if/when you update SilkTest, you'll lose all your changes.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  3. #3
    Senior Member
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    152
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Where are people adding new methods?

    Extend classes in your own include file.

    ------------------
    John O'Neill.
    Quality Automation Ltd.
    www.quality-automation.com
    John O'Neill.
    Quality Automation Ltd.
    www.quality-automation.com

  4. #4
    Moderator
    Join Date
    May 2001
    Location
    SanJose,CA,USA
    Posts
    363
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Where are people adding new methods?

    Include extend classes in your own include /Frame file


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

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Where are people adding new methods?

    It is best to leave the standard SilkTest classes alone -- that way the standard classes will behave as described in the help and your changes will not be lost when you upgrade.

    Put them in a special "Utilities.inc" or "TestLibrary.inc" file. "use" this file at the beginning of all of your ".t" files.

    Extend SilkTest's classes with names that indicate that they are extended and what classes they are extended from.

    In "TestLibrary.inc" file:
    In your testcase files:

    [This message has been edited by RobKapteyn (edited 08-15-2001).]
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  6. #6
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Where are people adding new methods?

    I agree with RobKapteyn that they should be in seperate files. Personally, I use the following naming conventions for my custom methods: "{AUTname}CustCtrl" and "{AUTname}Funct" for the custom functions. You only need to use the 'use' path once though in your frame file and all of your .t files will have access to these additional .inc files. I also have a Maintenance.t file which I use to verify if new objects are in the AUT that are not declared in the frame, among other things.

    Hope this helps,
    Steve

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


    [This message has been edited by Carrick1973 (edited 08-16-2001).]
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  7. #7
    Senior Member
    Join Date
    Aug 2001
    Location
    Manchester, NH
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Where are people adding new methods?

    OK, so overwhelmingly people have not been editing winclass.inc. There were two reasons that I was actually leaning towards doing that. One was that none of my windows are declared, and they won't be for the foreseeable future, as there are hundreds of windows, and I will not have much time with the app before the initial release So I can't use new classes (because the windows are just seen as the standard classes DialogBox("Select Source Code") when my script works with them. Therefore I seem to be limited to just extending existing classes, which runs me into the problem of inheritance, or lack thereof for extended standard classes. As far as I can determine adding a method to AnyWin in my own include file will not inherit down to other class, which is what I need to do.
    However if I add that same method to the class definition in winclass it inherits and does what I need, it's just not good practice to put it there like everyone has been pointing out.

    I guess my original question was a little misleading, I was kind of hoping everyone might say they were also just modifying winclass.inc and that would just let me off the hook for finding a better solution


    [This message has been edited by akuczkowski (edited 08-16-2001).]

    [This message has been edited by akuczkowski (edited 08-16-2001).]

  8. #8
    Junior Member
    Join Date
    Jun 2000
    Location
    Center Harbor, NH USA
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Where are people adding new methods?

    Although it seems that you do have valid reasons for editing winclass.inc, I'd leave it be for the sake of the person that has to deal with the upgrade to the next version of Silk

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

 

 

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 02:29 PM.

Copyright BetaSoft Inc.