SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    88
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    retrieving all the rows one time

    The web table in my web page which I am testing has 2000 rows. I can see only 30 rows at one time. There is button for in the web table which I could use for viewing the remaining rows. There is no functionality for me to view all rows at once. I need to check if the column is sorted. But when I use the getcelldata it retrieves only 30 rows at a time. How can i retrieve the remaining rows?

  2. #2
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    Is it next link or pagination links?

  3. #3
    Senior Member
    Join Date
    Dec 2004
    Location
    Australia
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    You can build a double dimensional array, build and increment the array as you proceed to the next page, then write a function to check if a particular column is sorted.

  4. #4
    Member
    Join Date
    Mar 2006
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    u have to have proceed to the next page either using any link like Next...or any other option so that ur table will be visible to QTP.

    for this make a loop ...if cell finished in 1st page then go to next page and cotinue ur loop...

    Thanks,
    Suarbh

  5. #5
    Member
    Join Date
    Dec 2007
    Posts
    88
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    I have to test 4 webpages each of them have arbitrary number of rows. So I can there won't be fixed number of rows .Could you please explain more about how would i handle this issue?

  6. #6
    Senior Member
    Join Date
    Jun 2007
    Location
    Toronto, Canada
    Posts
    362
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    Use the solution as mentioned above and for your question regarding arbitrary number of rows..
    Use Row count on each page and insert a condition for the loop saying that if the number of rows is less than 30 then Exit For otherwise proceed and click the next link

    In short:
    1. Create a FOR loop to get the first 30 rows(For a=1 to 30 Step 1)
    2. Within the loop, see if the Next button is enabled or disabled(use getROProperty to see if enabled)
    3. If enabled then continue
    4. Count number of rows in the table and see if data exists on all rows
    5. If number of rows is less than 30 then do Exit for Else click Next button

  7. #7
    Member
    Join Date
    Dec 2007
    Posts
    88
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    I did some thing like this doesn't seem to work

    Set objTable = Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").WebTable("Fund")

    intRowCount = objTable.RowCount
    intFirstDataRow = 2
    intCol13 = 17

    For intRow = intFirstDataRow to intRowCount
    ReDim Preserve arrCol13(intRow-2)
    arrCol13(intRow-2) = objTable.GetCellData(intRow, intCol13)
    print arrCol13(intRow-2)
    check_enabled = Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). GetROProperty("enabled")
    If check_enabled = true Then
    Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). Click
    End If
    Next

  8. #8
    Junior Member
    Join Date
    Nov 2007
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    Write out the process in plain language first, then try to code it. When I translate your code, the errors seem to be fairly obvious:

    1. Get the number of rows in the table on the initial page.
    2. For each row of the orignal table.
    2a. ...Get the value from Col13
    2b. ...Click "pagenext" if it's active.
    3. Loop back to 2

    You end up getting one value per page then go to the next page, but only for the number of rows in your initial page.

    I believe what you're trying to do is:
    1. Get the number of rows in that table
    2. For each row in the table
    2a. ... Get the value from Col13 and add it to the array
    3. Loop back to 2 (Next)
    4. If "pagenext" is active
    4a. ... click it.
    4a. ... Loop back to 1

    I'd also recommend against using a dynamic array, resizing it (ReDim Preserve) is a very memory intensive process. Another way of creating that array is creating a delimitted string and splitting it at the end. Example:

    <font class="small">Code:</font><hr /><pre>
    For x = 1 to 10
    sStr = sStr &amp; "value:" &amp; x &amp; "||" ' Delimitter is ||
    Next
    sStr = Left (nStr, Len(nStr - 2) ' Remove the final delimitter
    arrayValues = Split(sStr, "||")
    </pre><hr />

    Split is still a little intensive, but you're only doing it once instead of on every row.

    AA

  9. #9
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    Try this:

    <font class="small">Code:</font><hr /><pre> Do Until Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). GetROProperty("enabled")
    Set objTable = Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").WebTable("Fund")

    intRowCount = objTable.RowCount
    intFirstDataRow = 2
    intCol13 = 17

    For intRow = intFirstDataRow to intRowCount
    ReDim Preserve arrCol13(intRow-2)
    arrCol13(intRow-2) = objTable.GetCellData(intRow, intCol13)
    print arrCol13(intRow-2)
    Next
    If Not Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). GetROProperty("enabled") Then
    Exit Do
    End If
    Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). Click
    Loop </pre><hr />

  10. #10
    Member
    Join Date
    Dec 2007
    Posts
    88
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: retrieving all the rows one time

    When I print this
    Browser("SmartStream - WebConnect_2").Page("SmartStream - WebConnect_2").Frame("Frame_4").Image("pagenext"). GetROProperty("enabled")

    It doesn't print anything. It should print true right?

    The object is in OR. Please advise.

 

 
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.82%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:53 PM.

Copyright BetaSoft Inc.