SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    May 2000
    Location
    Austin,TX,USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to retain global variable value

    This is a follow-up post to my previous post concerning testing of 2 differnet versions of the AUT.

    I was able to set a global variable with the correct window declaration depending on the version of the AUT I'm running tests on using "if" statements. My problem now is that when I use the agent on different machines and run tests in concurrent mode, my global variable looses it's value and my tests fail because the correct window declaration is not found. For example, in my appstate declaration, I grab the window caption when the app is started and parse out the version number. I then use if statements to set the global variable depending on what version of the app is on the machine.
    if "1.0"
    wWindow = wMainwin.Toolbar.DialogBox1
    if "1.1"
    wWindow = wMainwin.Toolbar.DialogBox1.PageList1

    Does anyone have any suggestions on how to make the global variable retain it's value throughout the test runs, or some other way of dealing with this problem?

    Thanks,
    Marvin

  2. #2
    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 retain global variable value

    There are many ways you can do it...

    One way is to declare it as a compiler constant (in your settings).
    Another way is to declare it as a constant outside the testcases, in your include files or outside main().
    The last way incase you're using organizer to execute all your testcases, you can always use IniWrite() and IniRead() functions in your TestcaseEnter() and TestcaseExit() functions to pass variables between testcases. The ini functions can be downloaded in the Downloads section, (QAPLib1)

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

 

 

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 09:18 PM.

Copyright BetaSoft Inc.