Hi Razza,
   As far as per understanding, you want to get the local sheet value
and compare with some number(here 999) and you want to do this with
the GlobalSheet row count number of times.
If I am right, check this code it may help you.

For k=1 to DataTable.GetSheet(dtGlobalSheet).GetRowCount
                        x=(DataTable.Value("Column1",dtLocalSheet))
                        If x<999 Then
                                Reporter.ReportEvent micPass, "Run Status", 
"Script is running
fine" 'For example row 7 has value < 999 in this iteration
                        Else
                                Reporter.ReportEvent micFail, "Run Status", 
"Script is not running
fine" 'For example row 7 has value < 999 in this iteration
                        End If
                DataTable.SetCurrentRow(k+1)
Next


If you are using globalsheet just for looping (ignore global sheet)
and you are interested in looping around local sheet;

For k=1 to DataTable.GetSheet(dtLocalSheet).GetRowCount
                        x=(DataTable.Value("LocalA",dtLocalSheet))
                        If x<999 Then
                                Reporter.ReportEvent micPass, "Run Status", 
"Script is running
fine" 'For example row 7 has value < 999 in this iteration
                        Else
                                Reporter.ReportEvent micFail, "Run Status", 
"Script is not running
fine" 'For example row 7 has value < 999 in this iteration
                        End If
                DataTable.SetCurrentRow(k+1)
Next

Revert back, if any thing is required.

On Dec 5, 2:51 am, [email protected] wrote:
> Thank you Bhavin. I tried that way. Problem is I do always have +ve data,
> i.e., always have data smaller than 999, which means else part never
> executes. Therefore j never resets to 1.
>
> On Fri, Dec 4, 2009 at 3:33 PM, bhavin v patel <[email protected]> wrote:
>
> > 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]<mercuryqtp%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/MercuryQTP?hl=en

-- 
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

Reply via email to