SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Nov 2002
    Location
    revere ma usa
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How can i find how many rows there will be in a HTML Table dynamically

    The table rows differ each session
    I need to find the number of rows
    Any ideas?

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i find how many rows there will be in a HTML Table dynamically

    Is there string of text or object that is present in each row? If so count like this...

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">' Loop to count number of Images ##############################################
    Do Until HTMLImage(&quot;Caption=Add Index=&quot; &amp; X &amp; &quot;&quot;, tpAttachNoWait).Exists = False
    X = (X + 1)
    Loop
    X = (X - 1)

    Set a = TextPanel(&quot; The number of rows on the page is &quot; &amp; X)
    Sleep 5 '################################################# ######################</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    ~Alias~

  3. #3
    Member
    Join Date
    Nov 2002
    Location
    revere ma usa
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i find how many rows there will be in a HTML Table dynamically

    .EXISTS WORKS ONLY IF THE OBJECT EXISTED AND THEN DISAPPEARED .oTHER WISE IT IS A RUNTIME ERROR
    I TRIED EVERYTING.

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i find how many rows there will be in a HTML Table dynamically

    Did you use the parameter 'tpAttachNoWait'?
    ~Alias~

  5. #5
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i find how many rows there will be in a HTML Table dynamically

    Copy this script and run it againt this qaforums page...

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">X = 1
    ' Loop to count number of Images ###################################
    Do Until HTMLImage(&quot;Caption='Send New Private Message' Index=&quot; &amp; X &amp; &quot;&quot;, tpAttachNoWait).Exists = False
    X = (X + 1)
    Loop
    X = (X - 1)

    Set a = TextPanel(&quot; The number of posts on this page is: &quot; &amp; X)
    Sleep 10 '################################################# ####</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    ~Alias~

  6. #6
    Member
    Join Date
    Nov 2002
    Location
    revere ma usa
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i find how many rows there will be in a HTML Table dynamically

    wow although my case is a little different , I use the tpattachnowait successfully.Thanks a lot Alias .I owe you

  7. #7
    Junior Member
    Join Date
    May 2004
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can i find how many rows there will be in a HTML Table dynamically

    Just some advice, you'll be better off scripting against a dynamic table if it has a predictable ID. Using the Indicies of widgets tends to produce mostly just throw away scripts. You're better off if there is a definitive identifier. For instance if you were trying to get data from the first row/column something like:

    Dim SomeString As String
    SomeString = "Who Knows What"
    Dim Row As Integer
    Dim Col As Integer
    Row = 0
    Col = 3

    Do
    If ( HTMLTD("ID=UserTable_" & Row & "_" & Col, tpAttachNoWait ).Exists Then
    'We'll assume we only care about the information in the 3rd colum so the row is all that needs to change
    If( HTMLTD("ID=UserTable_" & Row & "_" & Col, tpAttachNoWait).InnerText = SomeString) Then
    ' Log the expected result with the actual result and exit the loop
    Exit Do
    Else
    ' Otherwise increment the row and continue the search
    ' If there were multiple pages of data you might want some kind of paging to be handled here.
    Row = Row + 1
    End If
    Else
    ' Call a vb error handler or make some kind of comment to the log if this wasn't expected
    ' Assume we've reached the bounds of the table and leave the loop
    Exit Do
    End If
    Loop

    Assuming this table is dynamic then thowing in the ID generation is a mere 3 maybe 4 extra lines of code on that part but a much added benefit to the longevity of the test.

 

 

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 10.34%
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 04:11 PM.

Copyright BetaSoft Inc.