SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2008
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Passing variable value from one action to other

    Is it possible to pass value of an variable from one action to other action?

    In my test, I am trying like this --
    For i = 1 to datatable.GetSheet("sheet name").Getrowcount
    Datatable.GetSheet("sheet name").setcurrentrow(i)
    RunAction "Copy of Sign on", oneIteration
    'Start recording here...
    RunAction "new action General", oneIteration
    'Start recording here...
    Next


    Copy of sign on got data table (not Global data table) with different login ids.
    Here I am trying to run whole action for all the logins.

    for the above logic, QTP keep running on first row never going to second row.

    thanks,

  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variable value from one action to other

    Check this forum's FAQs before asking "new" questions:

    34. Passing and then Dereferencing Parameters
    34.A http://www.sqaforums.com/showflat.ph...;Number=363610 --action parameters
    34.B http://www.sqaforums.com/showflat.ph...;Number=362922 --action parameters
    34.C http://www.sqaforums.com/showflat.ph...;Number=468664 --test parameters

  3. #3
    Junior Member
    Join Date
    Apr 2004
    Location
    Cincinnati, OH
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variable value from one action to other

    In addition to using action or test parameters there are several other ways for passing variables from one action to another within the same test case.

    A couple examples include:

    Example 1) Use environment variables as follows.
    In Action 1
    Environment.Value("envSomeVar") = SomeValue

    In Action 2
    msgbox Environment.Value("envSomeVar")

    Example 2) Use the Global Runtime Data Table as follows.

    In Action 1

    DIM varName, varValue
    varName = customerName
    varValue = Tim Jones

    ' Check if variable exists as param in the RTDT
    ' to determine whether to add new or update existing.
    ' Following code would likely be put in a function.
    On error resume next
    paramCheck = DataTable(varName, dtGlobalSheet)

    If err.number <> 0 Then
    'Param does not exist and must be added
    DataTable.GetSheet("Global").AddParameter varName,varValue
    Else
    'Param exists and should be updated
    DataTable.Value(varName,dtGlobalSheet) = varValue
    End If

    In Action 2

    msgbox DataTable.Value(varname, dtGlobalSheet)

    Some of the bit about checking for the existing param for the RTDT was pulled from some other post, though I'm sorry I don't know which one.

    Not sure of the syntax problem you are having where your first row keeps running.

    Anyone feel free to correct me if I'm wrong. Hope this helps.

    Regards

 

 

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.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 06:21 PM.

Copyright BetaSoft Inc.