Results 1 to 2 of 2
  1. #1

    Problem with data table iterations

    In my application, i have to run a script which makes specified rows in the data table as "Preferred" in the application.
    I have six rows in the data table local sheet. i run the action iteration for all rows. while running the script for first iteration It searches for the value of datatable in the application,when found, come out of the loop and its going good. but the later iterations again its starting from the start as its behavior. I dont want it to search again from the start. as my first iteration is succeeded.Its taking a long time.

    rwcount = Browser("xxxx").Page("xxxx").Frame("main_2").WbfGr id("Body_dgPrefs").RowCount

    For counter = 1 to rwcount
    Lender=trim(Browser("xxxx").Page("xxxx").Frame("ma in_2").WbfGrid("Body_dgPrefs").GetCellData(counter ,1))

    i =trim(DataTable("LenderNames", dtLocalSheet))

    If Lender = i Then
    Browser("xxxx").Page("xxxx").Frame("main_2").WbfGr id("Body_dgPrefs").SetCellData counter, 2, DataTable("Status", dtLocalSheet)
    Browser("xxxx").Page("xxxx").Frame("main_2").WbfGr id("Body_dgPrefs").SetCellData counter, 3, DataTable("Branch", dtLocalSheet)
    Exit For
    End If

    Please help, Is there any way in One iteration i can run all rows of the data table.
    thanks in advance.

  2. #2

    Re: Problem with data table iterations

    From QTP Help

    SetCurrentRow Method
    Sets the specified row as the current (active) row in the run-time Data Table.

    Note: You can only set a row that contains at least one value.



    RowNumber Number Indicates the number of the row to set as the active row.

    The following example uses the SetCurrentRow method to change the active row to the second row in the MySheet run-time data sheet.


    GetCurrentRow Method
    Returns the row number of the current (active) row in the run-time Data Table sheet.


    Return Value

    The following example uses the GetCurrentRow method to retrieve the row currently being used by the run-time Data Table and writes it to the report.

    row = DataTable.GetSheet("MySheet").GetCurrentRow

    Reporter.ReportEvent 1, "Row Number", row



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:41 PM.

Copyright BetaSoft Inc.