SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Jul 2001
    Location
    NY, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Calling another \'t\' file within a \'t\' file

    Hi,

    I want to call an external 't' file (say login.t) from another t file.

    Is there a way I can do it?

    At this point of time, another question that I have been having : if I want to use one function repeatedly(say login) (that contains some actions, say setactive, settext, click etc)in multiple tests, which is the best method to save them as - as 'inc' files or as 't' files ?

    If we save them as 'inc' files, does silk run the actions too when the function gets called?

    Thanks

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

  2. #2
    Member
    Join Date
    Oct 2000
    Location
    Bothell, WA, USA
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calling another \'t\' file within a \'t\' file

    You cannot call one script file (.t) from another script file.

    If you have a set of methods that you call repeatedly, you definitely want to save them in an include file (.inc). For each of my projects I have a "functions.inc" file that contains all of the functions that I call from my testcases (and from other functions). Depending on what your needs are, you can also create a "functions.inc" (or any other appropriately named include file) that you can use across multiple projects.

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

  3. #3
    Member
    Join Date
    Mar 2000
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calling another \'t\' file within a \'t\' file

    Srikanth-

    You may want to look into using a PLN file. So for a project say "TestApplication" you may have TestApplication.pln, TestApplication.t, functions.inc for SilkTest to use.

    The .t file will have the code for each test case. Install..Configure... Start Service...etc

    The .inc file will have the custom functions that can be called from the .t testcases.

    The .pln file will just be a list of the test cases corresponding to the .t test cases. You can highlight which tests you want to run or run them all.

    Peter



    [This message has been edited by PJCoviello (edited 08-29-2001).]

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

    Re: Calling another \'t\' file within a \'t\' file

    Srikanth,

    If you are having many .t files and u wanna execute selective testcases from them your best bet is plan file. Else make all testcases as publick function, keep them in a include file and in a single testcase call them in the order you wanna execute. Hope this helps.


    ------------------
    Sree
    Sree

  5. #5
    Member
    Join Date
    Jan 2001
    Location
    Fairfield, CT, USA
    Posts
    86
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calling another \'t\' file within a \'t\' file

    Hi MikeF,
    Can you send me those functions and library browser files for easy to use?
    Thank you
    Pal
    QA Analyst
    Pal.dhillon@divine.com

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

  6. #6
    Member
    Join Date
    Mar 2000
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calling another \'t\' file within a \'t\' file

    PalS-

    I think in the downloads section there is also a few generic function libraries that you can download.

    Peter

  7. #7
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calling another \'t\' file within a \'t\' file

    Where I work we have created a file for everyone that develops SilkTest to use that has about 50 - 60 reusable function. these are generic enough functions that any project using SilkTest should be able to use them. If the functions are not exactly what a scripter needs, they modify them and save them under a new name within their .inc file. In this way the basic functions remain unchanged, and can be used for instruction of new SilkTest scripters for code examples.

    I also created a Library Browser file that appends to the SilkTest default file that explains what each custom function does, just like the built in SilkTest functions.

    If you have questions please let me know.

    MikeF

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

  8. #8
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Calling another \'t\' file within a \'t\' file

    Here is an example of 3 files I use to update the Help file and set the new functions as a default .inc file for SilkTest to use.

    CFunc.txt - A text file formatted just like the original help files.
    CFunc.inc - The .inc file containing the new functions
    loadnewfiles.t - A script to install the help file and .inc file into the default areas needed to give everyone access to them.

    To use this file:
    1. Unzip these files into the d:\data\my documents directory
    2. Open up one instance of SilkTest with the loadnewfiles.t file in it.
    3. Open another instance of SilkTest with nothing in the view window.
    4. Start the loadnewfiles script. This script will copy the new file to the correct directories, and append the help file to the help file load list, and the .inc file to the default use file list.
    5. When the script has finished, close SilkTest.
    6. When you reopen SilkTest the new help file and .inc file will be available.

    I am not giving you all of the functions we have developed, just one and the corresponding Help information for it.

    This was recorded with SilkTest 5.03 and has worked for installation of these files on several machine, however they are meant only as a model for how you might create soemthing for your own use.

    MikeF


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

 

 

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 12:54 PM.

Copyright BetaSoft Inc.