SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Basic QTP LOOPING Question in between ACTIONS

    I have very basic question about looping. Here is what I am trying to do.

    I have Action1, which goes through one dataset and based on value of Action1 database, QTP jumps to Action2 and start executing Action2 database.

    Well, I get that to work. But, problem I am facing is that once QTP jumps from Action1 to Action2 and after looping through Action2, QTP returns back to Action1. That's when it starts from row#1 dataset in Action1.

    Here is coding:

    ****ACTION1******

    RowCount = DataTable.GetSheet("Action1").GetRowCount

    For i = 1 to RowCount

    GET VALUE FROM DATASET
    '
    '
    '
    '

    If CONDITIONAL STATEMENT Then
    RunAction "Action2"
    Else
    '
    '
    '
    End If

    DataTable.GetSheet("Action1").SetNextRow<= THIS IS WHERE QTP SUPPOSE TO MOVE ONTO NEXT RECORD WITHIN DATASET. HOWEVER, ONCE IT JUMPS BACK TO ACTION1, IT STARTS FROM ROW 1 IN ACTION1.


    Next


    PLEASE HELP!!!

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Location
    IL, US
    Posts
    408
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Basic QTP LOOPING Question in between ACTIONS

    Try the following

    RowCount = DataTable.GetSheet("Action1").GetRowCount
    For i = 1 to RowCount
    DataTable.GetSheet("Action1").SetCurrentRow(i)


    'Comment the following line
    'DataTable.GetSheet("Action1").SetNextRow
    Next

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

    Re: Basic QTP LOOPING Question in between ACTIONS

    What's wrong in that? You are looping yourself and at the end on the last row you jump again which takes you back to the first row

  4. #4
    Member
    Join Date
    Jun 2008
    Posts
    220
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Basic QTP LOOPING Question in between ACTIONS

    Hi,

    You have to use Datatable.SetCurrentRow("Row Number") in your action 1 to control row settings.
    I don't build Software but I make them work better, Testing is a Passion

 

 

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 10:11 AM.

Copyright BetaSoft Inc.