SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Jun 2005
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    In the single action, i need to call same scenario

    In the single action, i need to call same scenario for-loop in many times.

    how to do?

  2. #2
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    You mean to say action calling same action again?

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

    Re: In the single action, i need to call same scen

    yes.

  4. #4
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    You can do that by writing the scenario in a function.
    Look at the concept of function calling itself in the link provided below.
    http://www.sqaforums.com/showflat.php?Ca...true#Post442077

  5. #5
    Member
    Join Date
    Jun 2005
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    The following script is saved in the "Action 1"

    Browser().Window().winedit().set ""

    For i= 1 to 100
    msgbox i
    next

    Browser().Window().winedit().set "1"

    For i= 1 to 100
    msgbox i
    next

    Browser().Window().winedit().set "2"

    For i= 1 to 100
    msgbox i
    next

    here, iam using the same scenario for-loop many times in single action.In stead of this i want to know how to keep the same scenario for-loop common and to call that for-loop
    whenever required in the "Action 1"

  6. #6
    Junior Member
    Join Date
    Jul 2007
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    For j= 1 to 2
    Browser().Window().winedit().set j
    For i= 1 to 100
    msgbox i
    next
    next

    or create a function

    function whatever (param j)
    Browser().Window().winedit().set j
    For i= 1 to 100
    msgbox i
    next
    end function

    and call this function with the right param.

  7. #7
    Member
    Join Date
    Jun 2005
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    ok.
    whether i can give the function like this
    function check()
    For i= 1 to 100
    msgbox i
    next
    end function

  8. #8
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    Try something like this.

    Public Function MyFunc(arg1)
    Browser().Window().winedit().set arg1
    For i= 1 to 100
    Msgbox i
    Next
    End Function

    Call MyFunc("")
    Call MyFunc("1")
    Call MyFunc("2")

  9. #9
    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: In the single action, i need to call same scen

    You can always have to loops and do the same thing.

    <font class="small">Code:</font><hr /><pre>
    for z = 1 to 5
    Browser().Window().winedit().set CSTR(z)
    For i= 1 to 100
    msgbox i
    next
    next
    </pre><hr />

  10. #10
    Member
    Join Date
    Jun 2005
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: In the single action, i need to call same scen

    Thank everbody.

    I have used function for the same scenario. it is working fine.

    thanks for timebeing help

 

 

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 05:33 AM.

Copyright BetaSoft Inc.