SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How To Re-Evaluate Assignments Set At Compile Time

    Let's see if I can adequately explain my problem.<UL TYPE=SQUARE>
    <LI> I am calling a testcase from a testplan
    <LI> I specify in the plan that the testcase is to use a 'List Of X' for test data
    <LI> Some of the items in the 'List of X' are actual data values, and some are function calls
    <LI> The function calls open an .ini file and read a value
    <LI> The testcase does some steps, sets the values in the .ini file, then more steps, then uses the 'List of X'
    <LI> The 'List of X' is evaluated at compile time, such that the values loaded from the .ini file are from the previous run[/list]

    If that makes sense, then please tell me how I can re-evaluate the 'List of X' such that it uses the up-to-the-minute values in the .ini file...

    TIA,
    ~ Fred

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


    [This message has been edited by RagerXS (edited 12-12-2002).]

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    Where does the list get updated prior to being passed to the method?

    A pseudo-break down of the code:

    testcase:
    - The list is evaluated (read?)at this time, reading the .ini file values from previous run
    - Test steps execute: the .ini file values are updated,
    /* List should be updated here ? */
    and a method is called where the list is passed to the method

    John


    [This message has been edited by John J. Miller (edited 12-12-2002).]

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Location
    NC, United States
    Posts
    148
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    Would this help.... if you could declare the list global and change value of global... the list to the method would have the new values.

    ------------------
    -gram
    -gram

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    If the list of x represents a command sequence and the ini file modifies that sequence, then the list of x should not be used until after it has been modified.


    John


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

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    This is actually the case -- the list is not used until after the .ini file is modified.

    What appears to be happening is this:

    - Plan calls testcase passing several parameters, including the list in question
    - The list is evaluated at this time, reading the .ini file values from previous run
    - Test steps execute, the .ini file values are updated, and a method is called where the list is passed to the method
    - *** It's here that I want to re-evaluate the list and read the .ini file
    - The method instead receives the list with old parameters

    I'm using a stored list instead of building one dynamically because ideally I'd like to be able to change the scenario just by providing a different list and making another call from the testplan with the new list, and so on.

    ~ Fred

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

  6. #6
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by gram:
    Would this help.... if you could declare the list global and change value of global... the list to the method would have the new values.<HR></BLOCKQUOTE>Because I'm using a testplan, I can't use global variables because the Agent re-initializes them for each test it kicks off. I wish I could do it this way, but alas this is why I chose to use .ini file processing.

    ~ Fred

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

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by John J. Miller:
    Where does the list get updated prior to being passed to the method?<HR></BLOCKQUOTE>John,

    I think you've given me my answer... But first a recap: Because the list is evaluated as soon as the testplan passes it to the testcase, it gets old values from the .ini file. Then when I modify the .ini file at runtime the changes are ignored because the list does not get modified.

    On another note, I've been unable to modify my list with code (it's a set of field/value pairs and I'm attempting to modify the values). I've been able to use one list to construct a separate, modified list, but not to actually modify a list value (this is really a separate issue).

    Back to the problem at hand: The only way I can figure to do this is to make the first list a set of field/value pairs where all the values I want to get at runtime should start at NULL. Then when I get a NULL value I can simply process the .ini file to get a current value...

    So it appears I have my answer, but I'd appreciate confirmation from one of the experts that this indeed is the way to go.

    Thanks,
    ~ Fred

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

  8. #8
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>On another note, I've been unable to modify my list with code (it's a set of field/value pairs and I'm attempting to modify the values). I've been able to use one list to construct a separate, modified list, but not to actually modify a list value (this is really a separate issue). <HR></BLOCKQUOTE>
    This sounds very much like a scope issue where the list is modified inside the first testcase (as a configurator) but not transferred to a global list that will be used by all subsequent tests. (You can bench-check for this, or even watch it happen by configuring a main() routine to pass representations of $values to the configuring testcase, then debug step-into the second testcase to view its variables.)

    Also on a related note, have you considered replacing the 'list of X' with a list of records? Records are way more flexible.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Back to the problem at hand: The only way I can figure to do this is to make the first list a set of field/value pairs where all the values I want to get at runtime should start at NULL. Then when I get a NULL value I can simply process the .ini file to get a current value... <HR></BLOCKQUOTE>

    Another way it to write an actual .INC file directly, then include it in the .t files of subsequent plans with a "use" statement. This approach lead back into the topic title.

    John


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


    [This message has been edited by John J. Miller (edited 12-13-2002).]

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>This sounds very much like a scope issue where the list is modified inside the first testcase (as a configurator) but not transferred to a global list that will be used by all subsequent tests. (You can bench-check for this, or even watch it happen by configuring a main() routine to pass representations of $values to the configuring testcase, then debug step-into the second testcase to view its variables.)

    Also on a related note, have you considered replacing the 'list of X' with a list of records? Records are way more flexible.
    <HR></BLOCKQUOTE>This is out of order, but my 'List of X' is a list of records -- and yes, it's WAY more flexible.

    As for it being a scope issue, I can't see why. For example, let's say it's defined in the .inc file as lMyOriginalList, which gets compiled at runtime. Then I pass that to method ModifyList(LIST OF X lListToMod). If I modify lListToMod and then pass lListToMod to another method or function, it should keep the new values. It doesn't...

    ~ Fred

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

  10. #10
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How To Re-Evaluate Assignments Set At Compile Time

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by John J. Miller:
    Another way it to write an actual .INC file directly, then include it in the .t files of subsequent plans with a "use" statement. This approach lead back into the topic title.
    John
    <HR></BLOCKQUOTE>I'm confused? Can you elaborate on this?

    As for building a new list, as I had suggested I may try, this would require a significant rewrite effort. I'm still looking for a way to call that first list again to make it re-evaluate it's values. But I have a feeling I may have to scrap this idea...

    ~ Fred

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

 

 
Page 1 of 2 12 LastLast

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

Copyright BetaSoft Inc.