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
    Jun 2003
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Selecting a different row when calling action

    Hi All,

    I have a small problem I've been trying to figure out (please forgive me if this seems a bit basic for you gurus! :-)

    I have a re-useable action with some rows in that re-useable action's local sheet, each one containing a different user name.

    The action is shared throughout the test and is called by 8 (non-reuseable) actions.

    What I would like to do is use a different row every time the re-useable action is called, so the first time it takes 'Mary', then 'John' etc. So far it keeps using the first row even when it is called the 2nd, 3rd etc time.

    Any ideas?

    Cormac

  2. #2
    Member graemeal's Avatar
    Join Date
    Nov 2005
    Location
    Belfast
    Posts
    326
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting a different row when calling action

    I have a similar action that I use to create a client. It has an input parameter which states which client (ie row number) i want to create. I call it like this
    RunAction "Create_Client [Create_Client]", oneIteration, DataTable("Client", dtGlobalSheet)

    If I want to create 8 clients at one time, I call the action 8 times.
    Graeme

  3. #3
    Junior Member
    Join Date
    Jun 2003
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting a different row when calling action

    Thanks for the reply.

    I'm not sure where you pass the rowcount in, though.

    So, each time your action is called, it uses a different row?

  4. #4
    Junior Member
    Join Date
    Jun 2003
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting a different row when calling action

    Hi,

    A small update:

    I've managed to use DataTable.SetNextRow to change the row in the Global sheet. What I need is something to change the row in the Local sheet... or is this possible as the Action cannot access any global parameter?

  5. #5
    Advanced Member
    Join Date
    Mar 2007
    Location
    Salt Lake City, UT, USA
    Posts
    606
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting a different row when calling action

    Try:

    Datatable.LocalSheet.SetCurrentRow(var_RowToUse)

    You can put whatever you want in var_RowToUse.

    Also, there are two easy ways to pass parameters from one script to another (probably more than two but these are the two that I use).

    1. Store the row you want in an Environment Variable.
    -or-
    2. Pass the row you want as an output parameter of the calling script and receive it as an input parameter of your Create_Client script.

    I prefer the 2nd method when one script needs to pass one or more values to one other script, though I use environment variables sometimes, usually when they will be used globally throughout a test that calls many scripts that all want the same variable.

    Information on both methods can be found in QTP Help and on these forums.
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  6. #6
    Junior Member
    Join Date
    Jun 2003
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting a different row when calling action

    Great - thanks BW.

    I didn't know you could use the SetCurrentRow method with LocalSheet as it doesn't appear on the drop down after pressing '.'

    I'll give that a go - cheers!

    Cormac

 

 

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 10.71%
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 08:13 AM.

Copyright BetaSoft Inc.