You just need to reset the row number for the second iteration, I just
put the j=1 in else condition so when next time it will run the value
will reset to first row. I also run the smoke test to your code so
its working fine. I hope it will work. Please let us know
Regards
Bhavin
i = 1
DataTable.GlobalSheet.SetCurrentRow(i)
Do While i < 10
j = 1
DataTable.LocalSheet.SetCurrentRow(j)
Do While j < 20
If DataTable("Column1", dtLocalSheet) < 999 Then
Reporter.ReportEvent micPass, "Run Status", "Script is running
fine" 'For
example row 7 has value < 999 in this iteration
Else
j=1
Reporter.ReportEvent micPass, "DataTable Issue", "Hello QTP Guru,
can you
solve my issue?"
End If
Loop
j = j + 1
Loop
i = i + 1
On Dec 4, 9:11 am, [email protected] wrote:
> Any suggestion/help will be appreciated for the following issue. Thank you.
>
>
>
> On Thu, Dec 3, 2009 at 12:23 PM, <[email protected]> wrote:
> > Hi,
> > I am using both Global and Local sheet in my test.
> > I have a set of data in GlobalSheet and based on data on GlobalSheet my
> > script uses LocalSheet to complete testing.
> > Here is the problem:
>
> > Script reads row 1 of GlobalSheet and executes from row 1 of localSheet (I
> > have 400 rows in LocalSheet) and complete executing at row 57 of LocalSheet
> > (as expected)
>
> > In next iteration scripts reads row 2 of GlobalSheet and executes from row
> > 57 of LocalSheet.
>
> > How can I reset LocalSheet to row 1 at runtime so that at 2nd iteration
> > scripts executes from row 1 of LocalSheet.
>
> > Here is an example:
>
> > i = 1
> > DataTable.GlobalSheet.SetCurrentRow(i)
> > Do While i < 10
> > j = 1
> > DataTable.LocalSheet.SetCurrentRow(j)
> > Do While j < 20
> > If DataTable("Column1", dtLocalSheet) < 999 Then
> > Reporter.ReportEvent micPass, "Run Status", "Script is running fine"
> > 'For example row 7 has value < 999 in this iteration
> > Else
> > Reporter.ReportEvent micPass, "DataTable Issue", "Hello QTP Guru, can
> > you solve my issue?"
> > End If
> > Loop
> > j = j + 1
> > Loop
> > i = i + 1
>
> > At iteration 2 script executes from row 7 of Local Sheet.
>
> > Any help will be appreciated. Thanks.
>
> > MZR- Hide quoted text -
>
> - Show quoted text -
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en