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, 4 Months 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, 4 Months 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, 4 Months 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,160 02-28-2019, 11:46 AM
Last Post: naruoga
  Writing values to DataTable chewbecca 2 3,258 04-09-2015, 05:48 PM
Last Post: chinnikrishna
  Function return value is not passed during the 3rd iteration premanand1979 0 2,262 10-16-2014, 09:40 PM
Last Post: premanand1979
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 3,226 08-22-2013, 11:43 AM
Last Post: smartkarthi
Question User-Defined Environment Variables vs. Global Variables vs. DataTable Values imzeeshan 0 3,007 11-16-2012, 01:51 AM
Last Post: imzeeshan

Forum Jump:


Users browsing this thread: 1 Guest(s)