Results 1 to 7 of 7
  1. #1

    Getting the last row


    i have a table, consists of view icon for each record, i have to click on that icon to go to next screen.
    That icon is having only href which takes like "https://XXXXXX&creatorID=XXXX&Order_id=82323232&am p;item_id=819
    ". I am able to get that value in one of the column in data table...but in the table..any no of rows can be presented...i wanted to click on the last row and last but one row every time...how can i do that?


  2. #2

    Re: Getting the last row

    LastRow = oTable.RowCount


  3. #3

    Re: Getting the last row

    rowcount is available.
    how can i set the cursor to last row in the table?

  4. #4

    Re: Getting the last row

    You do not need to set cursor.
    As soon as you'll implement your click - QTP will know how to do that.
    You need exact click on particular cell of Table.
    Click on row - doesn't make sense.


  5. #5
    Senior Member
    Join Date
    Jul 2007
    Amman, Jordan

    Re: Getting the last row

    Add the icon to the object repository specifying a property that is valid for all the other icons (RegEx)
    for example:

    Also setting the Ordinal Identifier to Index 0

    As janna mentioned, you can get the number of rows using rowcount.

    to select the last row:

    Browser("XX").Page("XX").WebTable("XX").Link("XX") .SetTOProperty "index", LastRow

    1. LR Version: LR 9.5
    2. protocol: Web (HTTP/HTML)
    3. HTML-Advanced with URLs: No
    4. URL mode: N/A
    5. LR FP: N/A
    6. VuGen Recording: New Engine
    7. Web & Multimedia 1700 - Oracle E-Business 100
    8. support/maintenance contract active: yes
    9. Windows 2003 R2
    10. Did not file

  6. #6

    Re: Getting the last row

    Do not need any repository entry or reg expression. Your logic here is to click on the link by its index.

    1. Get the table :

    Set oTable = Browser("urname").Page("urname").WebTable("urname" ).Object

    2. Get Last Row :
    Set oRow = oTable.Rows(oTable.Rows.Length-1)

    (be careful since the last row is just a spacer sometimes so make sure u got the right one by debuging this exp:
    oRow.innertext) If not the right one then use oTable.Rows.Length-2 and etc.

    3.Get the link:

    I do not know why QTP has so many types of links, as for me,it always comes down to 1 type : A

    Set oLink = oRow.All.Tags("A")(0)

    Use (1) or (2) depending which link u need to click in that row. Its just an index.

    4. You free to do with that link whatever you want:

    QA automation

  7. #7

    Re: Getting the last row

    Bravo, Artem !




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 07:37 PM.

Copyright BetaSoft Inc.