SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to define script-level variable

    How can we declare a variable at script-level. so that scope of that variable is all actions within that script.
    Not all actions in all scripts.

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Jan 2000
    Location
    USA, CA
    Posts
    1,998
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to define script-level variable

    No way to declare variables with Dim.
    Use Environment variables instead.

    Janna

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to define script-level variable

    You can do it by declaring the variable in a script (.vbs file) and associate it with resource of your test. The variable would be available to all the actions in the test.

    jbotash, your point is valid when we are not looking at variables refering to objects.

  4. #4
    Member
    Join Date
    May 2005
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to define script-level variable

    Hi,
    It is definitely possible to declare a Test Script scope varible/parameter which can accessed in all the actions of that test. This can be done by creating parameters at Test-->Settings-->Parameters
    This is possible in QTP 8.0 and 8.2 I have no idea about other versions.
    Similarly you also create Action scope variable and Business Component scope variables.

    Regards,
    LN

  5. #5
    Junior Member
    Join Date
    Jan 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to define script-level variable

    Hello LN,

    Could you tell me how to access parameter which are defined in Test-->Settings-->Parameters> I tried various ways, can't retrieve value back

    thanks

  6. #6
    Member
    Join Date
    May 2005
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to define script-level variable

    Dimprash,
    You can access the parameters decalared in Test-->Settings-->Parameters> by using Parameter("ParamName") This does work.

    Regards,
    LN

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:02 PM.

Copyright BetaSoft Inc.