SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Finding thed innertest of a WebElement in a WebTab

    Hi everyone,

    I am trying to get the value of a web element in a table. I only want the data in column 5 of the WebTable.

    So far I have:

    For r = 1 to RowCount
    If r <> 2 Then
    ColCount = TableObj.ColumnCount(r)
    For c = 1 to ColCount
    ChildCount = TableObj.ChildItemCount(r, c, "WebElement")
    If ChildCount > 0 Then
    For k = 0 to ChildCount - 1
    rNumber = rNumber +1
    Set WebObj = WebElementObj.ChildItem(r, c, "WebElement", k)
    NumberOfPages = WebObj.GetROProperty("innerText")

    'Retrieve the column index
    objExcel.Cells(rNumber, 1).Value = NumberOfPages


    Next
    End If
    Next
    End If
    Next
    Thx for the help ;-)

    see ya

    Lorena

  2. #2
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    ??? so what are you getting? where are you having issue?
    ===========================================

  3. #3
    Member
    Join Date
    Jun 2004
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    Sorry Antoney,

    I am not able to just grab the 5th column innertext value which should be a number or empty. My code is finding all WebElements. In the 5th coulmn of the WebTable, I should find the number I need. But my code (and reopeated tries, fails to grab the number.

    I trried changing c to be 5, or c=5 (no For loop), but I get:

    Unspecific Error
    line(44) "ChildCount = TableObj.ChildItemCount(r, 5, "WebElement")"
    Thx for the help ;-)

    see ya

    Lorena

  4. #4
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    Can you post a sample html? it is hard to imagine how your table looks like.

    you can just create a page with just the table.
    ===========================================

  5. #5
    Member
    Join Date
    Jun 2004
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    Sure, see attachment

    thx for asking ;-)
    Attached Files Attached Files
    Thx for the help ;-)

    see ya

    Lorena

  6. #6
    Member
    Join Date
    Dec 2010
    Posts
    71
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    cant you do that with getcelldata?

    Thanks,
    Honey
    Honey Lahoti
    Test Consultant
    Infocept pvt ltd : www.infocepts.com

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

    Re: Finding thed innertest of a WebElement in a WebTab

    Thx Honey,

    I tried that in the past with no luck:


    'Find table to extract data from
    Set TableObj = Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All")

    rNumber = 1
    RowCount = TableObj.RowCount

    For r = 1 to RowCount
    If r <> 2 Then
    ColCount = TableObj.ColumnCount(r)
    For c = 1 to ColCount
    'msgbox ColCount
    ChildCountPage = TableObj.ChildItemCount(r, c, "WebElement")
    'msgbox ChildCountPage
    If ChildCountPage > 0 Then
    For k = 0 to ChildCountPage - 1
    rNumber = rNumber +1
    Set WebObj = TableObj.ChildItem(r, c, "WebElement", k)
    NumPages = WebObj.GetCellData("innertext")
    'msgbox NumPages
    If c = 5 Then
    'Retrieve the column index
    objExcel.Cells(rNumber, 6).Value = NumPages
    End If
    Next
    End If
    Next
    End If
    Next
    Thx for the help ;-)

    see ya

    Lorena

  8. #8
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    I created a dummy table and put this code in and i am getting data.
    <font class="small">Code:</font><hr /><pre>
    RowCount = Browser("Test").Page("Test").WebTable("h1").RowCou nt
    Set TblObj = Browser("Test").Page("Test").WebTable("h1")

    For r = 1 to RowCount
    msgbox TblObj.GetCellData(r, 5)
    Next

    </pre><hr />
    Attached Files Attached Files
    ===========================================

  9. #9
    Member
    Join Date
    Jun 2004
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    Antoney/Honey,

    When I use GetROData, my script runs, I just dont get any data returned. ;-)

    when I use GetCellData, I get the RunError:

    Object doesn't support this property or method: 'WebObj.GetCellData'
    Line (51): "NumPages = WebObj.GetCellData("innertext")".

    I attached my OS of my column 5 that I anm trying to get the number for.
    Attached Files Attached Files
    Thx for the help ;-)

    see ya

    Lorena

  10. #10
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Finding thed innertest of a WebElement in a WebTab

    Lorena,

    It seems you're not using the GetCellData method correctly. The syntax is:

    .GetCellData(Row, Column)
    Regards,

    Anshoo Arora
    Relevant Codes

 

 
Page 1 of 2 12 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 9.68%
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 10:38 AM.

Copyright BetaSoft Inc.