Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to stop getting values from DataTable after the result passed?
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi
I am getting values from Data table and using that values I am asserting.I want to Quit the for loop iteration after it get the correct reply code.
This is my code.
Code:
fr=DataTable.LocalSheet.GetRowCount
'Print fr
For i = 1 to fr
DataTable.SetCurrentRow(i)
print i
rc=DataTable.Value("oRc",3)
print rc
If Browser("").Page("").WebElement("innerhtml:="&rc,"html tag:=B","index:=0").Exist(1) Then
'reporter.ReportEvent micPass,"Test got result:"&rc,"Test Passed"
End If
Next

Thanks for your time.
Thank you
Uma
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Uma,

Exit For ' it will take out of the for loop.

if ...... Then
Exit For ' when a condition is met, we quit the for loop
End if
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi VIns,
it is working.
Thank You,
Uma
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Click after CheckProperty to a WebElement passed via Function argument fails naruoga 0 1,154 02-28-2019, 11:46 AM
Last Post: naruoga
  Writing values to DataTable chewbecca 2 3,251 04-09-2015, 05:48 PM
Last Post: chinnikrishna
  Function return value is not passed during the 3rd iteration premanand1979 0 2,253 10-16-2014, 09:40 PM
Last Post: premanand1979
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 3,215 08-22-2013, 11:43 AM
Last Post: smartkarthi
Question User-Defined Environment Variables vs. Global Variables vs. DataTable Values imzeeshan 0 3,002 11-16-2012, 01:51 AM
Last Post: imzeeshan

Forum Jump:


Users browsing this thread: 1 Guest(s)