SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Dec 2000
    Location
    seattle
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to include files at runtime

    Hi ,

    I am writing code that determines the path of a include file at runtime and uses the window declaration in the .inc file.

    I am unable to include the file name at run time.

    Can someone tell me how to import the file at run time so that i can use the window declaration.

  2. #2
    Junior Member
    Join Date
    Dec 2000
    Location
    seattle
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to include files at runtime

    I get the information of the file i need to use inside the test case.

    I need to do this because I have similar web pages (the difference might be a additional a text field).I have separate window declaration for each of these web pages.

    My files are organized in the following directory structure(simplified)

    common/Join.inc
    Hm/Join.inc
    Fy/JOin.inc
    Va/Join.inc

    If i have a web page whose definition fits the window declaration in Join.inc under common I want to import the file under common/Join.inc

    For all other specific web pages it will pick up the relevant Join.inc file.

    I don't want to import all the files in advance since I might not use all of them.

    Will this info help..

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    MA
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to include files at runtime

    Preethi,
    If you are looking to make your window declarations common, and introduce a TextField in special cases, I suggest you use winclasses instead.

    What you are attempting to accomplish is typically done with winclasses. Put all the common, generic objects / methods in a base class. Derive all HTML window declarations from the base class, and add objects or override methods as needed in the actual declaration.

    Attempting to identify windows and use different .inc paths at runtime can't be done, to my knowledge. With winclasses and functions like GetParent(), you can make runtime decisions.
    Steven Tyler
    Manager - Performance Engineering

    Kronos Incorporated
    tel: +1 978 947 4219

  4. #4
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to include files at runtime

    You cannot include a file (of code) during runtime because it compiles the code and runs it before it starts execution.

    You can include files of data in runtime though.

    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

  5. #5
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to include files at runtime

    I'm having a hard time coming up with a reason why you'd be doing this. It might help me and others to understand better if you provide a brief explanation of "why" or an example.

    The solution will depend on precisely what stage of runtime you have the information (path and/or filename, I'm assuming) available to be able to "use" the file of window decs.

    If the info is available at some point during the execution/loading of the actual frame file (before or during DefaultTestPlanEnter, DefaultScriptEnter, or DefaultTestcaseEnter) then I might have a solution for you. I've done something similar in regard to values for global variables during script development. But I don't want to go into the details if this isn't the case.

    If the info isn't available until somewhere within a testcase then I don't have any ideas off the top of my head.

  6. #6
    Member
    Join Date
    Dec 1999
    Location
    Portland, OR, USA
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to include files at runtime

    [QUOTE]Originally posted by pcostigan:
    [B]I'm having a hard time coming up with a reason why you'd be doing this. It might help me and others to understand better if you provide a brief explanation of "why" or an example.
    ===========

    Actually it can be a very handy thing to do. In the perl programming language it is possible to either include files at runtime using their "require" command, or at compile time via a "use" command similar to Silk.

    In my perl programming activites, I have found the require command to be a lifesaver on a few occcassions. With Silk I sometimes have to jump through some very high hoops to get around not having a "require" command equivalent.

    In the area of window declarations, it would be really nice if I could redefine the window cmd command line invocation on the fly using a require command. Right now I do the following workaround:

    I have a batch file called "temp.bat" and for the cmd invoke line I invoke temp.bat. Then I create temp.bat on the fly and write to it whatever command line I want to use. This can be useful when trying to test a command with a variety of switches which will give the same opening window in each case.

    Clumsy, but it works. A require command would be a bit more robust.

    The winclass idea described by the previous poster sounds like an interesting alternative.


    ------------------
    Charles F. Radley - CSQE
    Oregon, USA.

    [This message has been edited by cradley (edited 12-28-2000).]
    Quality Control Analyst at Syntel Inc
    Project Test Lead for client Daimler Trucks - North America.
    Interested in testing dot net web services and SOA systems.
    Charles F. Radley
    Oregon, USA.

 

 

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:53 AM.

Copyright BetaSoft Inc.