Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
exit iteration
#1
Solved: 11 Years, 3 Months, 1 Week ago
Hi,
I need an instruction to exit from the current interation of the script, starting with the next row of the datatable. Is it possible?
'ExitIteration' or 'Exit Iteration' is not recognized.
Thanks
Reply
#2
Solved: 11 Years, 3 Months, 1 Week ago
Please be clear on this question. Need more clarity on requirement
Reply
#3
Solved: 11 Years, 3 Months, 1 Week ago
I have some rows in DataTable, so some iterations when I run the script. I would like to have a command to exit from the current iteration withouth exit from the script, so that after this command the script continues to run with the next row of DataTable.
[and I would want that this command is available also within functions/subroutines]

thanks
Reply
#4
Solved: 11 Years, 3 Months, 1 Week ago
Nice Question. Let me know pls

Regards
Raj
Reply
#5
Solved: 11 Years, 3 Months, 1 Week ago
Can any one give the solution on this pls

Regards
Raj
Reply
#6
Solved: 11 Years, 3 Months, 1 Week ago
Hi,
You can use the following statements...

ExitActionIteration
Object.ExitCode
Exititeration
Reply
#7
Solved: 11 Years, 3 Months, 1 Week ago
Hi Sridhar,

It wub be great if u give the solution with example and code(if possible). I tried to use the function which u have given above are not working.

I wrote the script as below and it is working fine.

Code:
Dim currentNo
currentNo = DataTable("No.",DtGlobalSheet)
If Not currentNo= "2" and Not currentNo= "4" And Not currentNo= "5"  Then
Browser("Log In").Page("Log In").WebEdit("logon").Click
Browser("Log In").Page("Log In").WebEdit("logon").Set DataTable("No.", dtGlobalSheet)

End If

here i m skipping iteration based on values which are present in the row not on the basis of iterations. For expl if row consist value "2" then i m saying to skip that.

For for my knowledge shake i wud like to know what are all the functions we have in QTP to skip the iterations. pls give me the answer with example

Regards
Raj
Reply
#8
Solved: 11 Years, 3 Months, 1 Week ago
Dear Raj and All,

This is the example for ExitTestIteration...Please explore your self according to your needs.

1)First create a column with Name as no in DataTable and then enter five values say 1,2,3,4,5 in each row.
Please find the attached Screenshot for this.

2)Just write the following code in expert view..

Code:
no = DataTable("no",DtGlobalSheet)

If no=2 Then
    ExitTestIteration
    
End If

msgbox no
3)Change the settings by like this...

File-->settings..>>Run..>>Select Run On All Rows.

In this example i am skipping no 2 from the datatable.

Regards


Attached Files
.doc   ExitTestIteration.doc (Size: 94.5 KB / Downloads: 301)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 955 04-23-2020, 07:08 PM
Last Post: BGunay
  UFT Tool runs more than one iteration always cthossain 2 3,655 02-12-2017, 01:25 PM
Last Post: cthossain
  Function return value is not passed during the 3rd iteration premanand1979 0 2,240 10-16-2014, 09:40 PM
Last Post: premanand1979
  Iteration in Local sheets for UFT11.5 haithamQTP 1 3,170 02-27-2014, 09:12 AM
Last Post: supputuri
  Close on Exit Issue in QTP 11.0 EGBELL 1 3,160 02-02-2014, 03:39 PM
Last Post: EGBELL

Forum Jump:


Users browsing this thread: 1 Guest(s)